File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -131,23 +131,30 @@ jobs:
131131 - run :
132132 name : Determine tag name
133133 command : |
134- tag=$([ -n "${CIRCLE_TAG}" ] && echo "${CIRCLE_TAG:1}" || echo "${CIRCLE_BRANCH}")
135- echo "Mapping branch ${CIRCLE_BRANCH} to ${tag}"
136- echo "export TAG=${tag}" >> ${BASH_ENV}
134+ tags="${CIRCLE_BRANCH}"
135+ if [ -n "${CIRCLE_TAG}" ]; then
136+ minortag=$(echo ${CIRCLE_TAG} | sed 's/^\(v[0-9]*\.[0-9]*\)\..*$/\1/')
137+ majortag=$(echo ${CIRCLE_TAG} | sed 's/^\(v[0-9]*\)\..*$/\1/')
138+ tags="${CIRCLE_TAG:1} ${minortag:1} ${majortag:1}"
139+ fi
140+ echo "Mapping to tags: ${tags}"
141+ echo "export TAGS=\"${tags}\"" >> ${BASH_ENV}
137142 - run :
138143 name : Build Docker image
139144 command : |
140145 source ${BASH_ENV}
141- docker build \
142- --no-cache \
143- -t saltyrtc/saltyrtc-server-python:${TAG} \
144- .
146+ docker build --no-cache -t saltyrtc-server-python .
147+ for tag in ${TAGS}; do
148+ docker tag saltyrtc-server-python saltyrtc/saltyrtc-server-python:${tag}
149+ done
145150 - run :
146151 name : Push Docker image
147152 command : |
148153 source ${BASH_ENV}
149154 docker login -u ${DOCKER_USER} -p ${DOCKER_API_KEY}
150- docker push saltyrtc/saltyrtc-server-python:${TAG}
155+ for tag in ${TAGS}; do
156+ docker push saltyrtc/saltyrtc-server-python:${tag}
157+ done
151158 - when :
152159 condition : << parameters.rebuild >>
153160 steps :
You can’t perform that action at this time.
0 commit comments