From 1d4b8c4fae219735e79ca7018c3c061c1733a26b Mon Sep 17 00:00:00 2001 From: Mykola Morhun Date: Tue, 10 Sep 2024 16:35:47 +0300 Subject: [PATCH] Pass buildah build arguments to remote VM --- task-generator/remote/main.go | 4 ++-- task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml | 4 ++-- task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml | 4 ++-- task/buildah-remote/0.1/buildah-remote.yaml | 4 ++-- task/buildah-remote/0.2/buildah-remote.yaml | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/task-generator/remote/main.go b/task-generator/remote/main.go index 9ad7851bc2..f7fa665145 100644 --- a/task-generator/remote/main.go +++ b/task-generator/remote/main.go @@ -240,7 +240,7 @@ if ! [[ $IS_LOCALHOST ]]; then env += " -e " + e.Name + "=\"$" + e.Name + "\" \\\n" } podmanArgs += " -v \"$BUILD_DIR/scripts:/scripts:Z\" \\\n" - ret += "\n ssh $SSH_ARGS \"$SSH_HOST\" $PORT_FORWARD podman run " + env + "" + podmanArgs + " --user=0 --rm \"$BUILDER_IMAGE\" /" + containerScript + ret += "\n ssh $SSH_ARGS \"$SSH_HOST\" $PORT_FORWARD podman run " + env + "" + podmanArgs + " --user=0 --rm \"$BUILDER_IMAGE\" /" + containerScript + ` "$@"` // Sync the contents of the workspaces back so subsequent tasks can use them for _, workspace := range task.Spec.Workspaces { @@ -256,7 +256,7 @@ if ! [[ $IS_LOCALHOST ]]; then ret += ` buildah pull "oci:konflux-final-image:$IMAGE" else - bash ` + containerScript + ` + bash ` + containerScript + ` "$@" fi buildah images container=$(buildah from --pull-never "$IMAGE") diff --git a/task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml b/task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml index 515d160ec2..f6c4f8f19e 100644 --- a/task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml +++ b/task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml @@ -476,13 +476,13 @@ spec: -v "$BUILD_DIR/.docker/:/root/.docker:Z" \ -v "$BUILD_DIR/results/:/tekton/results:Z" \ -v "$BUILD_DIR/scripts:/scripts:Z" \ - --user=0 --rm "$BUILDER_IMAGE" /scripts/script-build.sh + --user=0 --rm "$BUILDER_IMAGE" /scripts/script-build.sh "$@" rsync -ra "$SSH_HOST:$BUILD_DIR/volumes/shared/" /shared/ rsync -ra "$SSH_HOST:$BUILD_DIR/volumes/workdir/" /var/workdir/ rsync -ra "$SSH_HOST:$BUILD_DIR/results/" "/tekton/results/" buildah pull "oci:konflux-final-image:$IMAGE" else - bash scripts/script-build.sh + bash scripts/script-build.sh "$@" fi buildah images container=$(buildah from --pull-never "$IMAGE") diff --git a/task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml b/task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml index 62d17e0fec..4c07aba43a 100644 --- a/task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml +++ b/task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml @@ -491,13 +491,13 @@ spec: -v "$BUILD_DIR/.docker/:/root/.docker:Z" \ -v "$BUILD_DIR/results/:/tekton/results:Z" \ -v "$BUILD_DIR/scripts:/scripts:Z" \ - --user=0 --rm "$BUILDER_IMAGE" /scripts/script-build.sh + --user=0 --rm "$BUILDER_IMAGE" /scripts/script-build.sh "$@" rsync -ra "$SSH_HOST:$BUILD_DIR/volumes/shared/" /shared/ rsync -ra "$SSH_HOST:$BUILD_DIR/volumes/workdir/" /var/workdir/ rsync -ra "$SSH_HOST:$BUILD_DIR/results/" "/tekton/results/" buildah pull "oci:konflux-final-image:$IMAGE" else - bash scripts/script-build.sh + bash scripts/script-build.sh "$@" fi buildah images container=$(buildah from --pull-never "$IMAGE") diff --git a/task/buildah-remote/0.1/buildah-remote.yaml b/task/buildah-remote/0.1/buildah-remote.yaml index c58694416d..530db59a53 100644 --- a/task/buildah-remote/0.1/buildah-remote.yaml +++ b/task/buildah-remote/0.1/buildah-remote.yaml @@ -469,13 +469,13 @@ spec: -v "$BUILD_DIR/.docker/:/root/.docker:Z" \ -v "$BUILD_DIR/results/:/tekton/results:Z" \ -v "$BUILD_DIR/scripts:/scripts:Z" \ - --user=0 --rm "$BUILDER_IMAGE" /scripts/script-build.sh + --user=0 --rm "$BUILDER_IMAGE" /scripts/script-build.sh "$@" rsync -ra "$SSH_HOST:$BUILD_DIR/workspaces/source/" "$(workspaces.source.path)/" rsync -ra "$SSH_HOST:$BUILD_DIR/volumes/shared/" /shared/ rsync -ra "$SSH_HOST:$BUILD_DIR/results/" "/tekton/results/" buildah pull "oci:konflux-final-image:$IMAGE" else - bash scripts/script-build.sh + bash scripts/script-build.sh "$@" fi buildah images container=$(buildah from --pull-never "$IMAGE") diff --git a/task/buildah-remote/0.2/buildah-remote.yaml b/task/buildah-remote/0.2/buildah-remote.yaml index c2ce635698..3f0bcdb549 100644 --- a/task/buildah-remote/0.2/buildah-remote.yaml +++ b/task/buildah-remote/0.2/buildah-remote.yaml @@ -473,13 +473,13 @@ spec: -v "$BUILD_DIR/.docker/:/root/.docker:Z" \ -v "$BUILD_DIR/results/:/tekton/results:Z" \ -v "$BUILD_DIR/scripts:/scripts:Z" \ - --user=0 --rm "$BUILDER_IMAGE" /scripts/script-build.sh + --user=0 --rm "$BUILDER_IMAGE" /scripts/script-build.sh "$@" rsync -ra "$SSH_HOST:$BUILD_DIR/workspaces/source/" "$(workspaces.source.path)/" rsync -ra "$SSH_HOST:$BUILD_DIR/volumes/shared/" /shared/ rsync -ra "$SSH_HOST:$BUILD_DIR/results/" "/tekton/results/" buildah pull "oci:konflux-final-image:$IMAGE" else - bash scripts/script-build.sh + bash scripts/script-build.sh "$@" fi buildah images container=$(buildah from --pull-never "$IMAGE")