Skip to content
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

Allow users to generate thoth configuration during the build process #190

Merged
merged 1 commit into from
Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Configuration options for Thoth's s2i image:

* ``THOTH_ADVISE`` - always use the recommended stack by Thoth (even if the lock file is present in the repo)
* ``THOTH_CONFIG_CHECK`` - verify values stated in the configuration file match the build environment
* ``THOTH_FORCE_GENERATE_CONFIG`` - generate configuration file during the build process, overwrites already existing configuration file if present
* ``THOTH_PROVENANCE_CHECK`` - verify stack provenance - the provenance check is triggered only if the lock file is not comming from Thoth's recommendation engine (otherwise the stack has already verified provenance)
* ``THOTH_ASSEMBLE_DEBUG`` - run s2i's assemble script in verbose mode
* ``THOTH_DRY_RUN`` - submit stack to Thoth's recommendation engine but do **NOT** use the recommended lock file, use the lock file present in the repo instead
Expand Down
7 changes: 7 additions & 0 deletions assemble
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ THOTH_CONFIG_CHECK=${THOTH_CONFIG_CHECK:-1}
THOTH_PROVENANCE_CHECK=${THOTH_PROVENANCE_CHECK:-1}
# Use Thamos from git instead of a PyPI release:
THOTH_FROM_MASTER=${THOTH_FROM_MASTER:-0}
# Generate .thoth.yaml file during the build process.
THOTH_FORCE_GENERATE_CONFIG=${THOTH_FORCE_GENERATE_CONFIG:-0}
# Thoth host to submit recommendations to:
export THOTH_HOST=${THOTH_HOST:-khemenu.thoth-station.ninja}
# Disable progressbar for thamos:
Expand All @@ -37,6 +39,11 @@ function restore_lock() {
[[ -f ../requirements.txt ]] && cp ../requirements.txt .
}

[[ ${THOTH_FORCE_GENERATE_CONFIG} -ne 0 ]] && {
rm -f .thoth.yaml
thamos config --no-interactive
}

[[ ${THOTH_CONFIG_CHECK} -ne 0 ]] && {
thamos check || {
if [[ ${THOTH_ERROR_FALLBACK} -ne 0 ]]; then
Expand Down