diff options
author | Cedric Ollivier <cedric.ollivier@orange.com> | 2021-07-01 08:42:20 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2021-07-01 08:42:20 +0000 |
commit | 0b20199a7300d3e5f7752f698dc01b75b31ca1ce (patch) | |
tree | b8bb1d4a2b4ce3c805073cced6ad69c3e56c2994 /jjb/functest | |
parent | fcd901a6dbe0e3f467543eacb0ed7eff13bbe761 (diff) | |
parent | b7bf83ddffbb3c7228ab9a6baf7f6b3b6ff714f3 (diff) |
Merge "Protect if {volumes} or env is None"
Diffstat (limited to 'jjb/functest')
-rw-r--r-- | jjb/functest/functest-kubernetes-pi.yaml | 10 | ||||
-rw-r--r-- | jjb/functest/functest-kubernetes.yaml | 10 | ||||
-rw-r--r-- | jjb/functest/functest-pi.yaml | 10 | ||||
-rw-r--r-- | jjb/functest/functest.yaml | 10 | ||||
-rw-r--r-- | jjb/functest/xtesting-pi.yaml | 10 | ||||
-rw-r--r-- | jjb/functest/xtesting.yaml | 12 |
6 files changed, 49 insertions, 13 deletions
diff --git a/jjb/functest/functest-kubernetes-pi.yaml b/jjb/functest/functest-kubernetes-pi.yaml index 986ea58d5..42c1a8c86 100644 --- a/jjb/functest/functest-kubernetes-pi.yaml +++ b/jjb/functest/functest-kubernetes-pi.yaml @@ -95,8 +95,14 @@ builders: - shell: | set +x - volumes=; for i in $(echo {volumes} | tr -d '[] ' |sed "s/,/ /g" ); do volumes="-v $i $volumes"; done - env=; for i in $(eval echo {env} | tr -d '[] ' |sed "s/,/ /g" ); do env="-e $i $env"; done + volumes=; + if [ "{volumes}" != "None" ]; then + for i in $(echo {volumes} | tr -d '[] ' |sed "s/,/ /g" ); do volumes="-v $i $volumes"; done + fi + env=; + if [ "{env}" != "None" ]; then + for i in $(eval echo {env} | tr -d '[] ' |sed "s/,/ /g" ); do env="-e $i $env"; done + fi [ ! -z "$WORKSPACE" ] && rm -rf $WORKSPACE/results || true if [ "{repo}" = "_" ]; then image={container}:{tag} diff --git a/jjb/functest/functest-kubernetes.yaml b/jjb/functest/functest-kubernetes.yaml index a42784ab3..a0bc4c2df 100644 --- a/jjb/functest/functest-kubernetes.yaml +++ b/jjb/functest/functest-kubernetes.yaml @@ -95,8 +95,14 @@ builders: - shell: | set +x - volumes=; for i in $(echo {volumes} | tr -d '[] ' |sed "s/,/ /g" ); do volumes="-v $i $volumes"; done - env=; for i in $(eval echo {env} | tr -d '[] ' |sed "s/,/ /g" ); do env="-e $i $env"; done + volumes=; + if [ "{volumes}" != "None" ]; then + for i in $(echo {volumes} | tr -d '[] ' |sed "s/,/ /g" ); do volumes="-v $i $volumes"; done + fi + env=; + if [ "{env}" != "None" ]; then + for i in $(eval echo {env} | tr -d '[] ' |sed "s/,/ /g" ); do env="-e $i $env"; done + fi [ ! -z "$WORKSPACE" ] && rm -rf $WORKSPACE/results || true if [ "{repo}" = "_" ]; then image={container}:{tag} diff --git a/jjb/functest/functest-pi.yaml b/jjb/functest/functest-pi.yaml index 663810ce0..a4d4b52b5 100644 --- a/jjb/functest/functest-pi.yaml +++ b/jjb/functest/functest-pi.yaml @@ -124,8 +124,14 @@ builders: - shell: | set +x - volumes=; for i in $(echo {volumes} | tr -d '[] ' |sed "s/,/ /g" ); do volumes="-v $i $volumes"; done - env=; for i in $(eval echo {env} | tr -d '[] ' |sed "s/,/ /g" ); do env="-e $i $env"; done + volumes=; + if [ "{volumes}" != "None" ]; then + for i in $(echo {volumes} | tr -d '[] ' |sed "s/,/ /g" ); do volumes="-v $i $volumes"; done + fi + env=; + if [ "{env}" != "None" ]; then + for i in $(eval echo {env} | tr -d '[] ' |sed "s/,/ /g" ); do env="-e $i $env"; done + fi [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true if [ "{repo}" = "_" ]; then image={container}:{tag} diff --git a/jjb/functest/functest.yaml b/jjb/functest/functest.yaml index e9086f07d..0b4d1b7e9 100644 --- a/jjb/functest/functest.yaml +++ b/jjb/functest/functest.yaml @@ -114,8 +114,14 @@ builders: - shell: | set +x - volumes=; for i in $(echo {volumes} | tr -d '[] ' |sed "s/,/ /g" ); do volumes="-v $i $volumes"; done - env=; for i in $(eval echo {env} | tr -d '[] ' |sed "s/,/ /g" ); do env="-e $i $env"; done + volumes=; + if [ "{volumes}" != "None" ]; then + for i in $(echo {volumes} | tr -d '[] ' |sed "s/,/ /g" ); do volumes="-v $i $volumes"; done + fi + env=; + if [ "{env}" != "None" ]; then + for i in $(eval echo {env} | tr -d '[] ' |sed "s/,/ /g" ); do env="-e $i $env"; done + fi [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true if [ "{repo}" = "_" ]; then image={container}:{tag} diff --git a/jjb/functest/xtesting-pi.yaml b/jjb/functest/xtesting-pi.yaml index 2ed916888..fa3c64427 100644 --- a/jjb/functest/xtesting-pi.yaml +++ b/jjb/functest/xtesting-pi.yaml @@ -87,8 +87,14 @@ builders: - shell: | set +x - volumes=; for i in $(echo {volumes} | tr -d '[] ' |sed "s/,/ /g" ); do volumes="-v $i $volumes"; done - env=; for i in $(eval echo {env} | tr -d '[] ' |sed "s/,/ /g" ); do env="-e $i $env"; done + volumes=; + if [ "{volumes}" != "None" ]; then + for i in $(echo {volumes} | tr -d '[] ' |sed "s/,/ /g" ); do volumes="-v $i $volumes"; done + fi + env=; + if [ "{env}" != "None" ]; then + for i in $(eval echo {env} | tr -d '[] ' |sed "s/,/ /g" ); do env="-e $i $env"; done + fi [ ! -z "$WORKSPACE" ] && rm -rf $WORKSPACE/results || true if [ "{repo}" = "_" ]; then image={container}:{tag} diff --git a/jjb/functest/xtesting.yaml b/jjb/functest/xtesting.yaml index 573e02ca5..ab770cd7b 100644 --- a/jjb/functest/xtesting.yaml +++ b/jjb/functest/xtesting.yaml @@ -86,9 +86,15 @@ name: xtesting-run-containers builders: - shell: | - set -ex - volumes=; for i in $(echo {volumes} | tr -d '[] ' |sed "s/,/ /g" ); do volumes="-v $i $volumes"; done - env=; for i in $(eval echo {env} | tr -d '[] ' |sed "s/,/ /g" ); do env="-e $i $env"; done + set +x + volumes=; + if [ "{volumes}" != "None" ]; then + for i in $(echo {volumes} | tr -d '[] ' |sed "s/,/ /g" ); do volumes="-v $i $volumes"; done + fi + env=; + if [ "{env}" != "None" ]; then + for i in $(eval echo {env} | tr -d '[] ' |sed "s/,/ /g" ); do env="-e $i $env"; done + fi [ ! -z "$WORKSPACE" ] && rm -rf $WORKSPACE/results || true if [ "{repo}" = "_" ]; then image={container}:{tag} |