on master help sign in
Push git tag on successful build of master (#47)

* are we able to cut and push a tag * actually push * install git * add deployment key fingerprint * use rw key * install openssh * ssh-keyscan * keyscan before push * install git ssh and scan before checkout * add tag push to deploy * echo pipeline number * tag with pipeline and build * pipeline number not id * do not tag during build_and_test

commit9092f25971e01c09a7b6b8ed12f9a74b630083c5 authorDan Stowell <danstowell@fastmail.com> dateTue 24 Mar 2020, 09:56 (7 years ago) parent12cfb4c
1 file changed+17−2
.circleci/config.yml+17−2
.circleci/config.yml+17−2
@@ -4,23 +4,38 @@ jobs:
44 docker:
55 - image: docker:18.09
66 steps:
7+ - add_ssh_keys:
8+ fingerprints:
9+ - "dd:6f:07:f7:7e:b0:ab:07:1c:1a:43:ba:a0:a3:b9:6f"
10+ - run: apk add --no-cache --no-progress make git openssh
11+ - run:
12+ name: Keyscan Github (HACK) #https://discuss.circleci.com/t/known-hosts-in-circle-2-0/18544
13+ command: ssh-keyscan -H github.com >> ~/.ssh/known_hosts
714 - checkout
815 - setup_remote_docker
9− - run: apk add --no-cache --no-progress make
1016 - run: make test-image
1117 build_test_and_deploy:
1218 docker:
1319 - image: docker:18.09
1420 steps:
21+ - add_ssh_keys:
22+ fingerprints:
23+ - "dd:6f:07:f7:7e:b0:ab:07:1c:1a:43:ba:a0:a3:b9:6f"
24+ - run: apk add --no-cache --no-progress make git openssh
25+ - run:
26+ name: Keyscan Github (HACK) #https://discuss.circleci.com/t/known-hosts-in-circle-2-0/18544
27+ command: ssh-keyscan -H github.com >> ~/.ssh/known_hosts
1528 - checkout
1629 - setup_remote_docker
17− - run: apk add --no-cache --no-progress make
1830 - run: make test-image
1931 - deploy:
2032 command: |
2133 echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
2234 docker tag prybar:latest replco/prybar:latest
2335 docker push replco/prybar:latest
36+ git tag "circleci_job_<< pipeline.number >>_build_${CIRCLE_BUILD_NUM}"
37+ git push origin "circleci_job_<< pipeline.number >>_build_${CIRCLE_BUILD_NUM}"
38+
2439workflows:
2540 ci:
2641 jobs: