1- version : 2
1+ version : 2.1
2+
3+ commands :
4+ return-if-not-deployed-branch :
5+ description : >-
6+ Exit and succeed this build step if it should not deploy images to DockerHub / upload CLI to AWS
7+ steps :
8+ - run :
9+ name : Exit build step if should not be deployed
10+ command : |
11+ if ! ([[ "$CIRCLE_BRANCH" =~ ^[0-9]\.[0-9]$ ]] || [[ "$CIRCLE_BRANCH" == "master" ]]); then
12+ echo "Exiting build step for branch which should not be deployed ($CIRCLE_BRANCH)"
13+ circleci step halt
14+ fi
15+ install-go :
16+ steps :
17+ - run :
18+ name : Install Go
19+ command : |
20+ wget https://dl.google.com/go/go1.11.5.linux-amd64.tar.gz
21+ sudo tar -C /usr/local -xzf go1.11.5.linux-amd64.tar.gz
22+ rm -rf go*.tar.gz
23+ echo 'export PATH=$PATH:/usr/local/go/bin' >> $BASH_ENV
24+ echo 'export PATH=$PATH:~/go/bin' >> $BASH_ENV
225
326jobs :
427 test :
528 docker :
629 - image : circleci/python:3.7.2-stretch
730 steps :
831 - checkout
9- - run : wget https://dl.google.com/go/go1.11.5.linux-amd64.tar.gz && sudo tar -C /usr/local -xzf go1.11.5.linux-amd64.tar.gz && rm -rf go*.tar.gz && echo 'export PATH=$PATH:/usr/local/go/bin' >> $BASH_ENV && echo 'export PATH=$PATH:~/go/bin' >> $BASH_ENV
32+ - install-go
1033 - run : GO111MODULE=off go get -u -v golang.org/x/lint/golint
1134 - run : sudo pip3 install black
1235 - run :
@@ -23,30 +46,32 @@ jobs:
2346 - run :
2447 name : Version Test
2548 command : make find-missing-version
26- deploy :
49+ build-and- deploy :
2750 docker :
2851 - image : circleci/python:3.7.2-stretch
2952 steps :
30- - run : wget https://dl.google.com/go/go1.11.5.linux-amd64.tar.gz && sudo tar -C /usr/local -xzf go1.11.5.linux-amd64.tar.gz && rm -rf go*.tar.gz && echo 'export PATH=$PATH:/usr/local/go/bin' >> $BASH_ENV && echo 'export PATH=$PATH:~/go/bin' >> $BASH_ENV
31- - run : sudo pip3 install awscli
32- - checkout
3353 - setup_remote_docker
54+ - install-go
55+ - checkout
3456 - run : make build-images
57+ - run : make build-cli
3558 - run : make test-python
59+ - return-if-not-deployed-branch
60+ - run : sudo pip3 install awscli
3661 - run : make push-images
3762 - run : make build-and-upload-cli
3863
3964workflows :
40- version : 2
41- build_and_test :
65+ version : 2.1
66+ build :
4267 jobs :
4368 - test
4469 - test-release :
4570 filters :
4671 branches :
4772 only :
4873 - /^[0-9]\.[0-9]$/
49- - deploy-approval :
74+ - build-and- deploy-approval :
5075 type : approval
5176 requires :
5277 - test
@@ -55,13 +80,8 @@ workflows:
5580 branches :
5681 only :
5782 - /^[0-9]\.[0-9]$/
58- - deploy :
83+ - build-and- deploy :
5984 requires :
6085 - test
6186 - test-release
62- - deploy-approval
63- filters :
64- branches :
65- only :
66- - /^[0-9]\.[0-9]$/
67- - master
87+ - build-and-deploy-approval
0 commit comments