Simplify travis.yml updates

Signed-off-by: Tilo Spannagel <development@tilosp.de>
This commit is contained in:
Tilo Spannagel 2018-11-15 22:11:34 +01:00
parent 0ebd883113
commit 99d823806e
No known key found for this signature in database
GPG Key ID: E517E9F206B8993D
1 changed files with 6 additions and 5 deletions

View File

@ -97,7 +97,7 @@ function create_variant() {
fi
for arch in i386 amd64; do
travisEnv='\n - env: VERSION='"$1"' VARIANT='"$variant"' ARCH='"$arch$travisEnv"
travisEnv=' - env: VERSION='"$1"' VARIANT='"$variant"' ARCH='"$arch"'\n'"$travisEnv"
done
}
@ -160,9 +160,10 @@ for version in "${versions_beta[@]}"; do
fi
done
# remove everything after '- stage: test images'
travis="$(awk '!p; /- stage: test images/ {p=1}' .travis.yml)"
echo "$travis" > .travis.yml
# replace the fist '-' with ' '
travisEnv="$(echo "$travisEnv" | sed '0,/-/{s/-/ /}')"
# update .travis.yml
travis="$(awk -v 'RS=\n\n' '$1 == "-" && $2 == "stage:" && $3 == "test" && $4 == "images" { $0 = " - stage: test images'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)"
echo "$travis" > .travis.yml
printf "$travisEnv" >> .travis.yml