-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable users to be able to provide their own config.toml #1171
Conversation
032df1a
to
9a09a89
Compare
34a6685
to
7025adb
Compare
@@ -148,6 +154,23 @@ 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}" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if [! -n "${CONFIG_TOML_FILE}" ] | |
if [! -n "${CONFIG_TOML_FILE}" ]; then |
if [! -n "${CONFIG_TOML_FILE}" ] | ||
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 | ||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Desired behavior:
config path | not specified (defaults to config.toml) | specified |
---|---|---|
exists | config.toml used | specified path used |
does not exist | empty conf used | error |
Current behavior:
config path | not specified (defaults to config.toml) | specified |
---|---|---|
exists | config.toml used ✔️ | specified path used ✔️ |
does not exist | error ❗ | error ✔️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM apart from one bash error and some log output details
Would be nice to squash the commits into logical units (probably just one commit)
83745c2
to
5c30601
Compare
This removes the default configuration (which also removes a default user and password from being injected into all images), instead deferring to the config.toml which is present in the source repository. If an invalid config file is provided, the build will fail. Otherwise, the task will use a config.toml file if it is present in the repository root or it will create an empty config file to use. Signed-off-by: arewm <[email protected]>
5c30601
to
c8f32df
Compare
/retest |
https://github.com/konflux-ci/build-definitions/pull/1165/checks?check_run_id=2785204219 I thinks that this PR causes that all PRs are failing on linter error ^, I don't know why this one passed the test though IMO this is the faulty line and linter makes it as false positive report |
This removes the default configuration (which also removes a default user and password from being injected into all images), instead deferring to the config.toml which is present in the source repository.
Before you complete this pull request ...
Look for any open pull requests in the repository with the title "e2e-tests update" and
see if there are recent e2e-tests updates that will be applicable to your change.