Skip to content

Commit

Permalink
Pass buildah build arguments to remote VM
Browse files Browse the repository at this point in the history
  • Loading branch information
mmorhun committed Sep 10, 2024
1 parent 020a43b commit 1d4b8c4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions task-generator/remote/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions task/buildah-remote/0.1/buildah-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions task/buildah-remote/0.2/buildah-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 1d4b8c4

Please sign in to comment.