Skip to content

Commit

Permalink
Try to make this make more sense
Browse files Browse the repository at this point in the history
The logic here was pretty confusing. Trying to straighten it out.
  • Loading branch information
ralphbean committed Jul 30, 2024
1 parent 1926f89 commit 1131462
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions task/build-vm-image/0.1/build-vm-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,20 +155,19 @@ spec:
ssh -v $SSH_ARGS "$SSH_HOST" mkdir -p "$BUILD_DIR/workspaces" "$BUILD_DIR/scripts" "$BUILD_DIR/tmp" "$BUILD_DIR/tekton-results" "$BUILD_DIR/entitlement"
if [! -n "${CONFIG_TOML_FILE}" ]; then
echo "No CONFIG_TOML_FILE specified"
if [ -f /var/workdir/source/config.toml ]; then
echo "Using the config.toml file found in the repository root!"
echo " Remove the config.toml file or set params.CONFIG_TOML_FILE to an invalid path to prevent its use."
else
echo "No config.toml file found. Set params.CONFIG_TOML_FILE to use one in the repository."
export CONFIG_TOML_FILE=config.toml
fi
echo "No CONFIG_TOML_FILE specified. Assuming config.toml"
export CONFIG_TOML_FILE=config.toml
fi
if [ -f "/var/workdir/source/${CONFIG_TOML_FILE}" ]; then
echo "Using the ${CONFIG_TOML_FILE} file found in the repository root!"
else
echo "No ${CONFIG_TOML_FILE} file found in the repository. Set params.${CONFIG_TOML_FILE}_FILE to a valid config.toml file."
exit 1
fi
# ensure that a config toml file is present in case one is not provided or the path is invalid
mkdir -p /var/workdir/source/$(dirname $CONFIG_TOML_FILE)
echo "Using the following config.toml file:"
cat /var/workdir/source/$CONFIG_TOML_FILE
echo "Using the following ${CONFIG_TOML_FILE} file:"
cat /var/workdir/source/$CONFIG_TOML_FILE
rsync -ra "/var/workdir/source/$CONFIG_TOML_FILE" "$SSH_HOST:$BUILD_DIR/config.toml"
rsync -ra "$HOME/.docker/" "$SSH_HOST:$BUILD_DIR/.docker/"
Expand Down

0 comments on commit 1131462

Please sign in to comment.