jobs/ttcn3: tweak shell cmd

Move 'cd' and './jenkins.sh' commands towards the end, so they are not
repeated in the case block of each pattern. This is in preparation for
the ggsn kernel mod test, which will need new patterns.

Related: OS#3208
Change-Id: I0fac24b961b1abb09317144ec2f65d4e21eb70c2
This commit is contained in:
Oliver Smith 2021-02-26 13:02:56 +01:00
parent 0001acdde8
commit 4521517d1f
1 changed files with 14 additions and 8 deletions

View File

@ -222,24 +222,30 @@
builders: builders:
- shell: |- - shell: |-
export REGISTRY_HOST="registry.osmocom.org" export REGISTRY_HOST="registry.osmocom.org"
# Translate job name to docker-playground dir and relevant
# environment variables
case "{job-name}" in case "{job-name}" in
TTCN3-centos-*-latest) TTCN3-centos-*-latest)
cd "$(echo "{job-name}" | sed s/^TTCN3-centos\-/ttcn3-/ | sed s/\-latest$//)" DIR="$(echo "{job-name}" | sed s/^TTCN3-centos\-/ttcn3-/ | sed s/\-latest$//)"
IMAGE_SUFFIX="latest-centos8" ./jenkins.sh export IMAGE_SUFFIX="latest-centos8"
;; ;;
TTCN3-centos-*) TTCN3-centos-*)
cd "$(echo "{job-name}" | sed s/^TTCN3-centos\-/ttcn3-/)" DIR="$(echo "{job-name}" | sed s/^TTCN3-centos\-/ttcn3-/)"
IMAGE_SUFFIX="master-centos8" ./jenkins.sh export IMAGE_SUFFIX="master-centos8"
;; ;;
*-latest) *-latest)
cd "$(echo "{job-name}" | sed s/\-latest$//)" DIR="$(echo "{job-name}" | sed s/\-latest$//)"
IMAGE_SUFFIX="latest" ./jenkins.sh export IMAGE_SUFFIX="latest"
;; ;;
*) *)
cd "{job-name}" DIR="{job-name}"
IMAGE_SUFFIX="master" ./jenkins.sh export IMAGE_SUFFIX="master"
;; ;;
esac esac
cd "$DIR"
./jenkins.sh
scm: scm:
- git: - git:
branches: branches: