I’m trying to retrieve the GIT_TAG value when ever I push a new tag during my tagged-build. Specifically, right before I push docker hub. The value is always.
I’m curious if I’m missing a piece.
version: 2.0
executorType: docker
containerInfo:
- image: python:3.5
jobs:
build:
workDir: /app
steps:- type: checkout
- type: shell
name: Install Docker
command: |
curl -L -o /tmp/docker.tgz https://get.docker.com/builds/Linux/x86_64/docker-1.12.3.tgz
tar -xz -C /tmp -f /tmp/docker.tgz
mv /tmp/docker/docker* /usr/bin/ - type: setup-docker-engine
reusable: true - type: shell
name: Build Docker Image
command: |
networks=$(docker network ls -f name=testing_network -q)
if [ -z "networks" ]; then docker network create -d bridge testing_network else echo OK fi containers=(docker ps -a -q)
if [ -z “$containers” ]; then
echo OK
else
docker stop $containers
docker rm $containers
fi
docker build -t andrewsynapse/historical_addresses:$CIRCLE_SHA1 -t andrewsynapse/historical_addresses:$CIRCLE_BRANCH .
docker run -d
–network testing_network --name=historical_addresses andrewsynapse/historical_addresses:$CIRCLE_BRANCH; sleep 5 - type: shell
name: Test Docker Image
command: |
docker exec historical_addresses python3 app/tests.py
test_exit_code=? docker stop (docker ps -a -q)
docker rm $(docker ps -a -q)
docker network rm testing_network
echo “This is all the env vars”
printenv
if [ $test_exit_code -ne 0 ]; then
exit 1
fi
workflows:
version: 2
untagged-build:
jobs:
- build
tagged-build:
jobs:
- build:
filters:
tags:
only: /[0-9]+(.[0-9]+)*/