aboutsummaryrefslogtreecommitdiff
path: root/tcwg-base
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2017-05-11 16:11:10 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2017-05-15 14:47:22 +0000
commit64559727e1af1146fe5a960f4056c8dfa769f7a3 (patch)
tree0deb8a9bccf3a1e7b6e25994169095e5d17c8ad1 /tcwg-base
parentcacf0e8f51a25d2719614523d3484becfe4e74bd (diff)
tcwg-base/*/build.sh: Support image versioning mirrored from git repo
Change-Id: I98000e2ef1f3dad5b012bbb5838ea64cd5a3dd31
Diffstat (limited to 'tcwg-base')
-rwxr-xr-xtcwg-base/build-image.sh9
-rwxr-xr-xtcwg-base/tcwg-build/build-image.sh9
-rwxr-xr-xtcwg-base/tcwg-dev/build-image.sh9
3 files changed, 24 insertions, 3 deletions
diff --git a/tcwg-base/build-image.sh b/tcwg-base/build-image.sh
index 6e3ac261..87e2b971 100755
--- a/tcwg-base/build-image.sh
+++ b/tcwg-base/build-image.sh
@@ -13,7 +13,14 @@ export LANG=C
distro=$(basename ${PWD} | cut -f1 -d '-')
arch=$(basename ${PWD} | cut -f2 -d '-')
name=$(basename ${PWD} | cut -f3- -d '-')
-image=linaro/ci-${arch}-${name}-ubuntu:${distro}
+if [ x"$GERRIT_BRANCH" != x"" ]; then
+ branch="$GERRIT_BRANCH"
+else
+ branch="$(git rev-parse --abbrev-ref HEAD)"
+fi
+# Append branch name to tag when building images from a non-master branch.
+branch=$(echo "$branch" | sed -e "s/^/-/g" -e 's/^-master$//')
+image=linaro/ci-${arch}-${name}-ubuntu:${distro}${branch}
baseimage=$(grep "^FROM" Dockerfile | head -n 1 | cut -d" " -f 2)
docker pull $baseimage 2>/dev/null || true
diff --git a/tcwg-base/tcwg-build/build-image.sh b/tcwg-base/tcwg-build/build-image.sh
index efc1f169..3b8fd2cd 100755
--- a/tcwg-base/tcwg-build/build-image.sh
+++ b/tcwg-base/tcwg-build/build-image.sh
@@ -13,7 +13,14 @@ export LANG=C
distro=$(basename ${PWD} | cut -f1 -d '-')
arch=$(basename ${PWD} | cut -f2 -d '-')
name=$(basename ${PWD} | cut -f3- -d '-')
-image=linaro/ci-${arch}-${name}-ubuntu:${distro}
+if [ x"$GERRIT_BRANCH" != x"" ]; then
+ branch="$GERRIT_BRANCH"
+else
+ branch="$(git rev-parse --abbrev-ref HEAD)"
+fi
+# Append branch name to tag when building images from a non-master branch.
+branch=$(echo "$branch" | sed -e "s/^/-/g" -e 's/^-master$//')
+image=linaro/ci-${arch}-${name}-ubuntu:${distro}${branch}
top=$(git rev-parse --show-toplevel)
rsync -a $top/tcwg-base/tcwg-build/tcwg-buildslave/ ./tcwg-buildslave/
diff --git a/tcwg-base/tcwg-dev/build-image.sh b/tcwg-base/tcwg-dev/build-image.sh
index 52c4a7ee..68412643 100755
--- a/tcwg-base/tcwg-dev/build-image.sh
+++ b/tcwg-base/tcwg-dev/build-image.sh
@@ -13,7 +13,14 @@ export LANG=C
distro=$(basename ${PWD} | cut -f1 -d '-')
arch=$(basename ${PWD} | cut -f2 -d '-')
name=$(basename ${PWD} | cut -f3- -d '-')
-image=linaro/ci-${arch}-${name}-ubuntu:${distro}
+if [ x"$GERRIT_BRANCH" != x"" ]; then
+ branch="$GERRIT_BRANCH"
+else
+ branch="$(git rev-parse --abbrev-ref HEAD)"
+fi
+# Append branch name to tag when building images from a non-master branch.
+branch=$(echo "$branch" | sed -e "s/^/-/g" -e 's/^-master$//')
+image=linaro/ci-${arch}-${name}-ubuntu:${distro}${branch}
top=$(git rev-parse --show-toplevel)
cat $top/tcwg-base/tcwg-dev/start.sh.tmpl \