Skip to content

Commit

Permalink
CircleCI build to DockerHub too
Browse files Browse the repository at this point in the history
Also as part of the CircleCI build create a container and push to docker hub.
  • Loading branch information
nshttpd authored Dec 17, 2018
1 parent 8d1c2e7 commit 83cbed4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ jobs:
- /^nshttpd.*/
steps:
- checkout
- run: make deploy
- setup_remote_docker:
version: 18.05.0-ce
- run: make dockerhub
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM alpine:3.6
EXPOSE 9436

COPY scripts/start.sh /app/
COPY mikrotik-exporter /app/
COPY dist/mikrotik-exporter_linux_amd64 /app/

RUN chmod 755 /app/*

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.armhf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM arm32v7/busybox:1.27.2
EXPOSE 9090

COPY scripts/start.sh /app/
COPY mikrotik-exporter /app/
COPY dist/mikrotik-exporter_linux_arm /app/

RUN chmod 755 /app/*

Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,10 @@ utils:
go get github.com/tcnksm/ghr

deploy: utils
gox -parallel=4 -ldflags "$(LDFLAGS)" -output "dist/mikrotik-exporter_{{.OS}}_{{.Arch}}"
ghr -t $(GITHUB_TOKEN) -u $(CIRCLE_PROJECT_USERNAME) -r $(CIRCLE_PROJECT_REPONAME) -replace $(VERSION) dist/
gox -os="linux freebsd netbsd" -arch="amd64 arm arm64 386" -parallel=4 -ldflags "$(LDFLAGS)" -output "dist/mikrotik-exporter_{{.OS}}_{{.Arch}}"
ghr -t $(GITHUB_TOKEN) -u $(CIRCLE_PROJECT_USERNAME) -r $(CIRCLE_PROJECT_REPONAME) -replace $(VERSION) dist/

dockerhub: deploy
@docker login -u $(DOCKER_USER) -p $(DOCKER_PASS)
docker build -t $(CIRCLE_PROJECT_USERNAME)/$(CIRCLE_PROJECT_REPONAME):$(VERSION) .
docker push $(CIRCLE_PROJECT_USERNAME)/$(CIRCLE_PROJECT_REPONAME):$(VERSION)
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.2-DEVEL
1.0.3

0 comments on commit 83cbed4

Please sign in to comment.