blob: 665a84029efabbf5608620e0d8d556bc0eb9d82c [file] [log] [blame]
Paul Sokolovskydedc4832022-01-17 23:26:30 +03001#!/bin/bash
2
3set -ex
4
5trap cleanup_exit INT TERM EXIT
6
7cleanup_exit()
8{
9 rm -rf ${HOME}/.docker
10 rm -f ${WORKSPACE}/{log,config.json,version.txt}
Paul Sokolovsky7676d852022-11-11 21:48:37 +030011 df -h
Paul Sokolovskydedc4832022-01-17 23:26:30 +030012}
13
14update_images=$(find -type f -name .docker-tag)
15
16for imagename in ${update_images}; do
17 (
18 docker_tag=$(cat $imagename)
19 if [ x"${GERRIT_BRANCH}" != x"master" ]; then
20 new_tag=${docker_tag}-${GERRIT_BRANCH}
21 docker tag ${docker_tag} ${new_tag}
22 docker_tag=${new_tag}
23 fi
24 echo successful build ${docker_tag}
25 )
26done
27
28if [ -e ${WORKSPACE}/log ]
29then
30 echo "some images failed:"
31 cat ${WORKSPACE}/log
32 exit 1
33fi