summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordd <dd@wx.tnyzeq.icu>2024-08-09 08:16:55 +0200
committerdd <dd@wx.tnyzeq.icu>2024-08-09 08:16:55 +0200
commit42b3735e2f1f685dda18352e09a24db4b0b4bc15 (patch)
tree7129c83b5bad495d8d3377c6be75e3ca6646acdb
parent37ca08a4177fe5eec1f4cb07cee8e5e8e93dde51 (diff)
downloadvyos-jenkins-42b3735e2f1f685dda18352e09a24db4b0b4bc15.tar.gz
vyos-jenkins-42b3735e2f1f685dda18352e09a24db4b0b4bc15.zip
fixed build iso argument escaping
-rw-r--r--auto/helper-logic4
-rwxr-xr-xbuild-iso.sh6
2 files changed, 6 insertions, 4 deletions
diff --git a/auto/helper-logic b/auto/helper-logic
index 200098d..b82c1d3 100644
--- a/auto/helper-logic
+++ b/auto/helper-logic
@@ -180,7 +180,7 @@ function Run {
function RunWithLazyStdout {
set -e
- command=$1
+ command="$1"
# stop the background command on ctrl+c
# and cleanup temporary file and tail on exit
@@ -210,7 +210,7 @@ function RunWithLazyStdout {
buffer=$(mktemp -p /tmp --suffix=-background-buffer)
- $command > $buffer &
+ eval "$command" > $buffer &
pid=$!
echo "Show output? Press y..."
diff --git a/build-iso.sh b/build-iso.sh
index eb5cbb6..7e11afd 100755
--- a/build-iso.sh
+++ b/build-iso.sh
@@ -89,7 +89,6 @@ function GetLatestTag {
customPackages="vyos-1x-smoketest"
customPackages=${CUSTOM_PACKAGES:-$customPackages}
-echo "Using CUSTOM_PACKAGES=$customPackages"
echo "Building the ISO..."
if [ "$BRANCH" == "equuleus" ]; then
@@ -97,6 +96,7 @@ if [ "$BRANCH" == "equuleus" ]; then
RELEASE_NAME="$LATEST-release-$DATE"
function DockerBuild {
+ echo "Using arguments: --build-by '$1' --version '$2' --custom-package '$3'"
docker run --rm --privileged -v ./vyos-build/:/vyos -v "/tmp/apt.gpg.key:/opt/apt.gpg.key" -w /vyos --sysctl net.ipv6.conf.lo.disable_ipv6=0 -e GOSU_UID=$(id -u) -e GOSU_GID=$(id -g) -w /vyos vyos/vyos-build:equuleus \
sudo ./configure \
--architecture amd64 \
@@ -116,6 +116,7 @@ elif [ "$BRANCH" == "sagitta" ]; then
RELEASE_NAME="$LATEST-release-$DATE"
function DockerBuild {
+ echo "Using arguments: --build-by '$1' --version '$2' --custom-package '$3'"
docker run --rm --privileged --name="vyos-build" -v ./vyos-build/:/vyos -v "/tmp/apt.gpg.key:/opt/apt.gpg.key" -w /vyos --sysctl net.ipv6.conf.lo.disable_ipv6=0 -e GOSU_UID=$(id -u) -e GOSU_GID=$(id -g) -w /vyos vyos/vyos-build:sagitta \
sudo --preserve-env ./build-vyos-image iso \
--architecture amd64 \
@@ -132,8 +133,9 @@ else
exit 1
fi
-dockerBuild="DockerBuild $BUILD_BY $RELEASE_NAME $customPackages"
+dockerBuild="DockerBuild \"$BUILD_BY\" \"$RELEASE_NAME\" \"$customPackages\""
if ! IsFlagSet "-v" "$@"; then
+ dockerBuild=${dockerBuild//\"/\\\"} # escape double quotes with backslash
dockerBuild="RunWithLazyStdout \"$dockerBuild\""
fi