diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2021-07-01 11:10:13 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2021-07-01 11:10:13 +0200 |
commit | 788258da45285c27801ca08a8564722c6e1e7284 (patch) | |
tree | a65ed76c9256ff681d9e512f08fcfa7efabdfc98 /jjb | |
parent | b7bf83ddffbb3c7228ab9a6baf7f6b3b6ff714f3 (diff) |
Protect if {volumes} or env is None (zip part)
Change-Id: Id17fc3b4c5420174f48984ffe8c48054f8e6a30e
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'jjb')
-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 | 10 |
6 files changed, 48 insertions, 12 deletions
diff --git a/jjb/functest/functest-kubernetes-pi.yaml b/jjb/functest/functest-kubernetes-pi.yaml index 42c1a8c86..a874110f0 100644 --- a/jjb/functest/functest-kubernetes-pi.yaml +++ b/jjb/functest/functest-kubernetes-pi.yaml @@ -428,8 +428,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 a0bc4c2df..c49eaf042 100644 --- a/jjb/functest/functest-kubernetes.yaml +++ b/jjb/functest/functest-kubernetes.yaml @@ -418,8 +418,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 a4d4b52b5..8c7092303 100644 --- a/jjb/functest/functest-pi.yaml +++ b/jjb/functest/functest-pi.yaml @@ -687,8 +687,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 0b4d1b7e9..0a4dc2aae 100644 --- a/jjb/functest/functest.yaml +++ b/jjb/functest/functest.yaml @@ -577,8 +577,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 fa3c64427..0a4c023fa 100644 --- a/jjb/functest/xtesting-pi.yaml +++ b/jjb/functest/xtesting-pi.yaml @@ -257,8 +257,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 ab770cd7b..f4d988dca 100644 --- a/jjb/functest/xtesting.yaml +++ b/jjb/functest/xtesting.yaml @@ -245,8 +245,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} |