aboutsummaryrefslogtreecommitdiff
path: root/ci-dockerfiles-deployment/report.sh
blob: fe0ac53d993a0f6be5d5456ec56444f3e426bc75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash

set -ex

trap cleanup_exit INT TERM EXIT

cleanup_exit()
{
    rm -rf ${HOME}/.docker
    rm -f ${WORKSPACE}/{log,config.json,version.txt}
}

update_images=$(find -type f -name .docker-tag)

for imagename in ${update_images}; do
  (
    docker_tag=$(cat $imagename)
    if [ x"${GERRIT_BRANCH}" != x"master" ]; then
      new_tag=${docker_tag}-${GERRIT_BRANCH}
      docker tag ${docker_tag} ${new_tag}
      docker_tag=${new_tag}
    fi
    echo successful build ${docker_tag}
  )
done

if [ -e ${WORKSPACE}/log ]
then
    echo "some images failed:"
    cat ${WORKSPACE}/log
    exit 1
fi