version: 2.1 workflows: docker: jobs: - build - deploy: context: - docker requires: - build matrix: parameters: program: [frontend, proxy] image_arch: [i386, amd64, arm32v7, arm64v8, ppc64le, s390x] filters: branches: only: master jobs: build: docker: - image: circleci/golang:1.15 working_directory: /go/src/github.com/xddxdd/bird-lg-go 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: - image: circleci/golang:1.15 working_directory: /go/src/github.com/xddxdd/bird-lg-go parameters: image_arch: type: string program: type: string steps: - checkout - setup_remote_docker: version: 19.03.13 - run: name: Install GPP command: | sudo apt-get update && sudo apt-get install -y gpp - run: name: Build Docker image environment: IMAGE_ARCH: << parameters.image_arch >> PROGRAM: << parameters.program >> BUILD_ID: << pipeline.number >> command: | make _crossbuild echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin make DOCKER_USERNAME=$DOCKER_USERNAME \ BUILD_ID=circleci-build$BUILD_ID \ $PROGRAM/$IMAGE_ARCH