-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
112 additions
and
0 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,112 @@ | ||
jobs: | ||
build-branches-amd64: | ||
machine: true | ||
steps: | ||
- checkout | ||
- run: | ||
name: Build an amd64 container image | ||
command: | | ||
docker build -t wise2c-devops/golang:alpine-gcc -f golang-gcc/Dockerfile golang-gcc | ||
docker run -v $(pwd):/go/src/github.com/wise2c-devops/pagoda -w /go/src/github.com/wise2c-devops/pagoda wise2c-devops/golang:alpine-gcc go build | ||
docker build -t wise2c/pagoda:amd64-$CIRCLE_BRANCH . | ||
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD | ||
docker push wise2c/pagoda:amd64-$CIRCLE_BRANCH | ||
build-tags-amd64: | ||
machine: true | ||
steps: | ||
- checkout | ||
- run: | ||
name: Build an amd64 container image | ||
command: | | ||
docker build -t wise2c-devops/golang:alpine-gcc -f golang-gcc/Dockerfile golang-gcc | ||
docker run -v $(pwd):/go/src/github.com/wise2c-devops/pagoda -w /go/src/github.com/wise2c-devops/pagoda wise2c-devops/golang:alpine-gcc go build | ||
docker build -t wise2c/pagoda:amd64-$CIRCLE_TAG . | ||
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD | ||
docker push wise2c/pagoda:amd64-$CIRCLE_TAG | ||
build-branches-aarch64: | ||
machine: true | ||
resource_class: arm.medium | ||
steps: | ||
- checkout | ||
- run: | ||
name: Build an aarch64 container image | ||
command: | | ||
docker build -t wise2c-devops/golang:alpine-gcc -f golang-gcc/Dockerfile golang-gcc | ||
docker run -v $(pwd):/go/src/github.com/wise2c-devops/pagoda -w /go/src/github.com/wise2c-devops/pagoda wise2c-devops/golang:alpine-gcc go build | ||
docker build -t wise2c/pagoda:aarch64-$CIRCLE_BRANCH . | ||
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD | ||
docker push wise2c/pagoda:aarch64-$CIRCLE_BRANCH | ||
build-tags-aarch64: | ||
resource_class: arm.medium | ||
machine: true | ||
steps: | ||
- checkout | ||
- run: | ||
name: Build an aarch64 container image | ||
command: | | ||
docker build -t wise2c-devops/golang:alpine-gcc -f golang-gcc/Dockerfile golang-gcc | ||
docker run -v $(pwd):/go/src/github.com/wise2c-devops/pagoda -w /go/src/github.com/wise2c-devops/pagoda wise2c-devops/golang:alpine-gcc go build | ||
docker build -t wise2c/pagoda:aarch64-$CIRCLE_TAG . | ||
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD | ||
docker push wise2c/pagoda:aarch64-$CIRCLE_TAG | ||
build-branches-multi-arch: | ||
machine: true | ||
steps: | ||
- run: | ||
name: Build a multi-arch container image | ||
command: | | ||
docker manifest create wise2c/pagoda:$CIRCLE_BRANCH wise2c/pagoda:amd64-$CIRCLE_BRANCH wise2c/pagoda:aarch64-$CIRCLE_BRANCH | ||
docker manifest annotate wise2c/pagoda:$CIRCLE_BRANCH wise2c/pagoda:amd64-$CIRCLE_BRANCH --os linux --arch amd64 | ||
docker manifest annotate wise2c/pagoda:$CIRCLE_BRANCH wise2c/pagoda:aarch64-$CIRCLE_BRANCH --os linux --arch arm64 | ||
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD | ||
docker manifest push wise2c/pagoda:$CIRCLE_BRANCH | ||
build-tags-multi-arch: | ||
machine: true | ||
steps: | ||
- run: | ||
name: Build a multi-arch container image | ||
command: | | ||
docker manifest create wise2c/pagoda:$CIRCLE_TAG wise2c/pagoda:amd64-$CIRCLE_TAG wise2c/pagoda:aarch64-$CIRCLE_TAG | ||
docker manifest annotate wise2c/pagoda:$CIRCLE_TAG wise2c/pagoda:amd64-$CIRCLE_TAG --os linux --arch amd64 | ||
docker manifest annotate wise2c/pagoda:$CIRCLE_TAG wise2c/pagoda:aarch64-$CIRCLE_TAG --os linux --arch arm64 | ||
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD | ||
docker manifest push wise2c/pagoda:$CIRCLE_TAG | ||
workflows: | ||
version: 2 | ||
build-for-branches: | ||
jobs: | ||
- build-branches-amd64 | ||
- build-branches-aarch64 | ||
- build-branches-multi-arch: | ||
requires: | ||
- build-branches-amd64 | ||
- build-branches-aarch64 | ||
build-for-tags: | ||
jobs: | ||
- build-tags-amd64: | ||
filters: | ||
tags: | ||
only: /^v.*/ | ||
branches: | ||
ignore: /.*/ | ||
- build-tags-aarch64: | ||
filters: | ||
tags: | ||
only: /^v.*/ | ||
branches: | ||
ignore: /.*/ | ||
- build-tags-multi-arch: | ||
requires: | ||
- build-tags-amd64 | ||
- build-tags-aarch64 | ||
filters: | ||
tags: | ||
only: /^v.*/ | ||
branches: | ||
ignore: /.*/ |