From 8d0618fed970b66f237c0691dfb0711f6e5aa1cf Mon Sep 17 00:00:00 2001 From: Lan Tian Date: Fri, 15 Jan 2021 00:41:38 +0800 Subject: [PATCH] Update CircleCI config --- .circleci/config.yml | 12 ++++++++++-- .travis.yml | 46 -------------------------------------------- 2 files changed, 10 insertions(+), 48 deletions(-) delete mode 100644 .travis.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 8d1af1b..5710929 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5af0ba9..0000000 --- a/.travis.yml +++ /dev/null @@ -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