Skip to content

Commit

Permalink
Create config.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
alanpeng authored Oct 22, 2023
1 parent 77262df commit 6b4de4b
Showing 1 changed file with 112 additions and 0 deletions.
112 changes: 112 additions & 0 deletions .circleci/config.yml
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: /.*/

0 comments on commit 6b4de4b

Please sign in to comment.