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 875880a
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions task/build-vm-image/0.1/build-vm-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,21 +154,20 @@ spec:
echo "$BUILD_DIR"
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
if [ ! -n "${CONFIG_TOML_FILE}" ]; then
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 875880a

Please sign in to comment.