CircleCI build to DockerHub too

Also as part of the CircleCI build create a container and push to docker hub.
This commit is contained in:
Steve Brunton 2018-12-16 23:28:05 -05:00 committed by GitHub
parent 8d1c2e7700
commit 83cbed45d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 6 deletions

View File

@ -10,4 +10,6 @@ jobs:
- /^nshttpd.*/
steps:
- checkout
- run: make deploy
- setup_remote_docker:
version: 18.05.0-ce
- run: make dockerhub

View File

@ -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/*

View File

@ -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/*

View File

@ -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)

View File

@ -1 +1 @@
1.0.2-DEVEL
1.0.3