Skip to content

Commit

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

* Fix gofmt error

* Update testing

* Update README.md

* Update function name

* Use go module to replace dep
  • Loading branch information
kairen authored Jul 31, 2019
1 parent f5e1286 commit ae50ce7
Show file tree
Hide file tree
Showing 28 changed files with 1,257 additions and 1,358 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/ip-assigner
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/ip-assigner"
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 ae50ce7

Please sign in to comment.