Update CircleCI config

This commit is contained in:
Lan Tian 2021-01-15 00:41:38 +08:00
parent f8ea511d44
commit 8d0618fed9
No known key found for this signature in database
GPG Key ID: 3D2E9DC81E5791C7
2 changed files with 10 additions and 48 deletions

View File

@ -25,6 +25,8 @@ jobs:
steps:
- checkout
- run: go get -v -t -d ./...
- run: go get -u github.com/kevinburke/go-bindata/...
- run: cd frontend && go generate
- run: go test -v ./...
deploy:
docker:
@ -37,6 +39,8 @@ jobs:
type: string
steps:
- checkout
- setup_remote_docker:
version: 19.03.13
- run:
name: Build Docker image
environment:
@ -55,12 +59,16 @@ jobs:
-f $PROGRAM/Dockerfile \
$PROGRAM
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
# Tag image :{arch} and :{arch}-build{build number}
docker push $DOCKER_USERNAME/$IMAGE_NAME:$IMAGE_ARCH
docker tag $DOCKER_USERNAME/$IMAGE_NAME:$IMAGE_ARCH $DOCKER_USERNAME/$IMAGE_NAME:$IMAGE_ARCH-build$CIRCLE_BUILD_NUM
docker push $DOCKER_USERNAME/$IMAGE_NAME:$IMAGE_ARCH-build$CIRCLE_BUILD_NUM
if [ "$IMAGE_ARCH" = "amd64" ]; then
# Tag as latest for amd64 images
docker tag $DOCKER_USERNAME/$IMAGE_NAME:$IMAGE_ARCH $DOCKER_USERNAME/$IMAGE_NAME:latest
docker push $DOCKER_USERNAME/$IMAGE_NAME:latest
docker tag $DOCKER_USERNAME/$IMAGE_NAME:$IMAGE_ARCH $DOCKER_USERNAME/$IMAGE_NAME:build$CIRCLE_BUILD_NUM
docker push $DOCKER_USERNAME/$IMAGE_NAME:latest
fi
docker push $DOCKER_USERNAME/$IMAGE_NAME

View File

@ -1,46 +0,0 @@
language: minimal
os: linux
dist: focal
services:
- docker
env:
- PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=i386
- PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=amd64
- PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=arm32v7
- PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=arm64v8
- PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=ppc64le
- PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=s390x
- PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=i386
- PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=amd64
- PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=arm32v7
- PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=arm64v8
- PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=ppc64le
- PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=s390x
addons:
apt:
update: true
packages:
- qemu-user-static
- binfmt-support
install:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
script:
- |
# Build image
docker build \
--build-arg IMAGE_ARCH=$IMAGE_ARCH \
-t $DOCKER_USERNAME/$IMAGE_NAME:$IMAGE_ARCH \
-f $PROGRAM/Dockerfile \
$PROGRAM
# Tag image :{arch} and :{arch}-build{build number}
docker tag $DOCKER_USERNAME/$IMAGE_NAME:$IMAGE_ARCH $DOCKER_USERNAME/$IMAGE_NAME:$IMAGE_ARCH-build$TRAVIS_BUILD_NUMBER
if [ "$IMAGE_ARCH" = "amd64" ]; then
# Tag as latest for amd64 images
docker tag $DOCKER_USERNAME/$IMAGE_NAME:$IMAGE_ARCH $DOCKER_USERNAME/$IMAGE_NAME:latest
docker tag $DOCKER_USERNAME/$IMAGE_NAME:$IMAGE_ARCH $DOCKER_USERNAME/$IMAGE_NAME:build$TRAVIS_BUILD_NUMBER
fi
- docker push $DOCKER_USERNAME/$IMAGE_NAME