-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Jenkins: allow to programmatically override all params in Jenkinsfile (…
…#136) This new `CONFIG_PARAMETERS_SCRIPT_URL` is different than the previous `CONFIG_OVERRIDE_SCRIPT_URL` in that it overrides all the Jenkins params much sooner so all regular processing can take place. When the regular processing are not enough and we need additional customizations, then we use the other `CONFIG_OVERRIDE_SCRIPT_URL`. The two override scripts complement each other by hooking into the process at different moment in time, and together they allow full complete override of the various options for the test run. Furthermore, `CONFIG_OVERRIDE_SCRIPT_URL` can also be a local file that is created on the fly by `CONFIG_PARAMETERS_SCRIPT_URL` so in the end, only `CONFIG_PARAMETERS_SCRIPT_URL` is needed for a full complete override.
- Loading branch information
Showing
7 changed files
with
155 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
# Sample Jenkins params override script to only run notebooks that hit GeoServer. | ||
# Intended for param CONFIG_PARAMETERS_SCRIPT_URL. | ||
|
||
# Enable all repos so we can filter all for them for notebooks that hit GeoServer. | ||
TEST_PAVICS_SDI_REPO="true" | ||
TEST_FINCH_REPO="true" | ||
TEST_PAVICS_LANDING_REPO="true" | ||
TEST_LOCAL_NOTEBOOKS="true" | ||
TEST_RAVEN_REPO="true" | ||
TEST_RAVENPY_REPO="true" | ||
|
||
# Force use the local GeoServer, to test the local GeoServer. Otherwise the | ||
# production GeoServer will be used, which defeat the purpose of the test. | ||
# Need to 'export' because TEST_NO_USE_PROD_DATA was meant to be used in | ||
# EXTRA_TEST_ENV_VAR Jenkins build param. TEST_NO_USE_PROD_DATA is not | ||
# directly one of Jenkins build param. Build params do not need 'export'. | ||
export TEST_NO_USE_PROD_DATA=1 | ||
|
||
# Chain with the other override script to filter the notebooks that hit | ||
# GeoServer only. | ||
CONFIG_OVERRIDE_SCRIPT_URL="https://raw.githubusercontent.com/Ouranosinc/PAVICS-e2e-workflow-tests/master/test-override/geoserver-nb-only.include.sh" | ||
|
||
# Set different test branch if required. | ||
#PAVICS_SDI_BRANCH="" | ||
#FINCH_BRANCH="" | ||
#PAVICS_LANDING_BRANCH="" | ||
#RAVEN_BRANCH="" | ||
#RAVENPY_BRANCH="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
# Sample Jenkins params override script to only run Raven notebooks | ||
# with the proper --nbval-lax switch. | ||
# Intended for param CONFIG_PARAMETERS_SCRIPT_URL. | ||
|
||
# Disable default repos. | ||
TEST_PAVICS_SDI_REPO="false" | ||
TEST_FINCH_REPO="false" | ||
TEST_PAVICS_LANDING_REPO="false" | ||
TEST_LOCAL_NOTEBOOKS="false" | ||
|
||
# Enable raven repos. | ||
TEST_RAVEN_REPO="true" | ||
TEST_RAVENPY_REPO="true" | ||
|
||
# Raven nbs outputs are not fully up-to-date or regexed escaped properly like | ||
# the other default nbs so need --nbval-lax for the moment. | ||
PYTEST_EXTRA_OPTS="$PYTEST_EXTRA_OPTS --nbval-lax" | ||
|
||
# Set different test branch if required. | ||
#RAVEN_BRANCH="" | ||
#RAVENPY_BRANCH="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/sh | ||
# Sample Jenkins params override script to demonstrate on-the-fly | ||
# CONFIG_OVERRIDE_SCRIPT_URL file creation. | ||
# This script is intended for param CONFIG_PARAMETERS_SCRIPT_URL. | ||
|
||
# Scenario: we only want to run 2 specific Raven notebooks: | ||
# * 10_Data_assimilation.ipynb | ||
# * 11_Climatological_ESP_forecasting.ipynb | ||
|
||
# The beginning is same as jenkins-params-raven-nb-only.include.sh so just | ||
# re-use it. | ||
|
||
# Log content of override script for traceability. | ||
cat test-override/jenkins-params-raven-nb-only.include.sh | ||
|
||
. test-override/jenkins-params-raven-nb-only.include.sh | ||
|
||
# Then we create CONFIG_OVERRIDE_SCRIPT_URL file on-the-fly to filter for the 2 | ||
# notebooks that we want. | ||
|
||
CONFIG_OVERRIDE_SCRIPT_URL="/tmp/specific-raven-nb.include.sh" | ||
|
||
echo ' | ||
#!/bin/sh | ||
# Sample config override script to only run 2 specific raven notebooks. | ||
NEW_NB_LIST="" | ||
for nb in $NOTEBOOKS; do | ||
if echo "$nb" | grep -i -e 10_Data_assimilation -e 11_Climatological_ESP_forecasting; then | ||
NEW_NB_LIST="$NEW_NB_LIST $nb" | ||
fi | ||
done | ||
NOTEBOOKS="$NEW_NB_LIST" | ||
' > "$CONFIG_OVERRIDE_SCRIPT_URL" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters