-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into taskcluster-support
- Loading branch information
Showing
23 changed files
with
394 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
# These environment variables must be set in CircleCI UI | ||
# | ||
# DOCKERHUB_REPO - docker hub repo, format: <username>/<repo> | ||
# DOCKER_USER - login info for docker hub | ||
# DOCKER_PASS | ||
# | ||
version: 2 | ||
jobs: | ||
build: | ||
docker: | ||
- image: docker:stable-git | ||
working_directory: /dockerflow | ||
steps: | ||
- checkout | ||
- setup_remote_docker | ||
|
||
- run: | ||
name: Create a version.json | ||
command: | | ||
# create a version.json per https://github.com/mozilla-services/Dockerflow/blob/master/docs/version_object.md | ||
printf '{"commit":"%s","version":"%s","source":"https://github.com/%s/%s","build":"%s"}\n' \ | ||
"$CIRCLE_SHA1" \ | ||
"$CIRCLE_TAG" \ | ||
"$CIRCLE_PROJECT_USERNAME" \ | ||
"$CIRCLE_PROJECT_REPONAME" \ | ||
"$CIRCLE_BUILD_URL" > version.json | ||
- run: | ||
name: Build Docker image | ||
command: docker build -t app:build . | ||
|
||
# save the built docker container into CircleCI's cache. This is | ||
# required since Workflows do not have the same remote docker instance. | ||
- run: | ||
name: docker save app:build | ||
command: mkdir -p /cache; docker save -o /cache/docker.tar "app:build" | ||
- save_cache: | ||
key: v1-{{ .Branch }}-{{epoch}} | ||
paths: | ||
- /cache/docker.tar | ||
|
||
test: | ||
docker: | ||
- image: docker:18.02.0-ce | ||
steps: | ||
- setup_remote_docker | ||
- restore_cache: | ||
key: v1-{{.Branch}} | ||
- run: | ||
name: Restore Docker image cache | ||
command: docker load -i /cache/docker.tar | ||
|
||
- run: | ||
name: Test Code | ||
command: docker run app:build go test -mod vendor -v ./... | ||
|
||
deploy: | ||
docker: | ||
- image: docker:18.02.0-ce | ||
steps: | ||
- setup_remote_docker | ||
- restore_cache: | ||
key: v1-{{.Branch}} | ||
- run: | ||
name: Restore Docker image cache | ||
command: docker load -i /cache/docker.tar | ||
|
||
- run: | ||
name: Deploy to Dockerhub | ||
command: | | ||
echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin | ||
# deploy master | ||
if [ "${CIRCLE_BRANCH}" == "master" ]; then | ||
docker tag app:build ${DOCKERHUB_REPO}:latest | ||
docker push ${DOCKERHUB_REPO}:latest | ||
elif [ ! -z "${CIRCLE_TAG}" ]; then | ||
# deploy a release tag... | ||
echo "${DOCKERHUB_REPO}:${CIRCLE_TAG}" | ||
docker tag app:build "${DOCKERHUB_REPO}:${CIRCLE_TAG}" | ||
docker images | ||
docker push "${DOCKERHUB_REPO}:${CIRCLE_TAG}" | ||
fi | ||
workflows: | ||
version: 2 | ||
build-test-deploy: | ||
jobs: | ||
- build: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
|
||
- test: | ||
requires: | ||
- build | ||
filters: | ||
tags: | ||
only: /.*/ | ||
|
||
- deploy: | ||
requires: | ||
- build | ||
- test | ||
filters: | ||
tags: | ||
only: /.*/ | ||
branches: | ||
only: master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
language: go | ||
go: | ||
- 1.6 | ||
- 1.11 | ||
- tip | ||
|
||
go_import_path: go.mozilla.org/cloudops-deployment-proxy | ||
|
||
install: true | ||
- 1.x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
FROM golang:1 | ||
FROM golang:1.14 | ||
|
||
COPY version.json /app/version.json | ||
COPY . /go/src/go.mozilla.org/cloudops-deployment-proxy | ||
RUN go install go.mozilla.org/cloudops-deployment-proxy | ||
COPY . /app | ||
|
||
WORKDIR /app | ||
EXPOSE 8000 | ||
|
||
RUN go install -mod vendor go.mozilla.org/cloudops-deployment-proxy | ||
|
||
CMD ["cloudops-deployment-proxy"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module go.mozilla.org/cloudops-deployment-proxy | ||
|
||
go 1.14 | ||
|
||
require ( | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
github.com/stretchr/testify v1.1.4-0.20160524234229-8d64eb7173c7 | ||
github.com/urfave/cli v1.17.1-0.20160608151511-fa949b48f384 | ||
go.mozilla.org/mozlog v0.0.0-20160610165107-cd74695caf44 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= | ||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||
github.com/stretchr/testify v1.1.4-0.20160524234229-8d64eb7173c7 h1:5KNW+VDCZxdFJasHPW1AehzhTIm69pHQq2psutjjXRk= | ||
github.com/stretchr/testify v1.1.4-0.20160524234229-8d64eb7173c7/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= | ||
github.com/urfave/cli v1.17.1-0.20160608151511-fa949b48f384 h1:nYZrQfefkHIWNPwwIToQOnTeZ5nQt4nUHiS4wHQBWSA= | ||
github.com/urfave/cli v1.17.1-0.20160608151511-fa949b48f384/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= | ||
go.mozilla.org/mozlog v0.0.0-20160610165107-cd74695caf44 h1:ZwI2d4V8jjame21x82EXAGuKKStymcxBsNt0hkN4/5E= | ||
go.mozilla.org/mozlog v0.0.0-20160610165107-cd74695caf44/go.mod h1:jHoPAGnDrCy6kaI2tAze5Prf0Nr0w/oNkROt2lw3n3o= |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.