Skip to content

Commit

Permalink
Refactor codes (#36)
Browse files Browse the repository at this point in the history
* Refactor codes

* Bump k8s deployment to v0.7.0
  • Loading branch information
kairen committed Jul 27, 2019
1 parent aa4573c commit d0ab17f
Show file tree
Hide file tree
Showing 30 changed files with 1,048 additions and 1,251 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ vendor/
out/
tmp/

pkg/client/listers/
pkg/client/informers/
.vscode/

17 changes: 5 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,13 @@ sudo: required
services:
- docker
go:
- 1.11.x
- 1.12.x
go_import_path: github.com/inwinstack/ipam
before_install:
- go get -u github.com/golang/dep/cmd/dep
env:
- GO111MODULE=on
script:
- make dep
- go mod download
- make test
- make
after_success:
- bash <(curl -s https://codecov.io/bash)
- |
if [[ "$TRAVIS_BRANCH" =~ release-* ]]; then
# Log into Docker Hub.
docker login -u="$DOCKER_USER" -p="$DOCKER_PASSWORD"
make build_image
make push_image
fi
- bash <(curl -s https://codecov.io/bash)
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Building stage
FROM inwinstack/golang:1.11-alpine AS build-env
FROM kairen/golang-dep:1.12-alpine AS build
LABEL maintainer="Kyle Bai <[email protected]>"

ENV GOPATH "/go"
ENV PROJECT_PATH "$GOPATH/src/github.com/inwinstack/ipam"
ENV GO111MODULE "on"

COPY . $PROJECT_PATH
RUN cd $PROJECT_PATH && \
make dep && \
make && mv out/controller /tmp/controller

# Running stage
FROM alpine:3.7
COPY --from=build-env /tmp/controller /bin/controller
ENTRYPOINT ["controller"]
COPY --from=build /tmp/controller /bin/controller
ENTRYPOINT ["controller"]
Loading

0 comments on commit d0ab17f

Please sign in to comment.