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

config: add new DEFAULT_CONFIG_PARAMETERS_SCRIPT_URL #17

Merged
merged 7 commits into from
Feb 22, 2025
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ services:
IS_PROD: $JENKINS_IS_PROD
ENABLE_SCHEDULED_TRIGGER: $JENKINS_ENABLE_SCHEDULED_TRIGGER
DEFAULT_PAVICS_HOST: $JENKINS_DEFAULT_PAVICS_HOST
DEFAULT_CONFIG_PARAMETERS_SCRIPT_URL: $DEFAULT_CONFIG_PARAMETERS_SCRIPT_URL
SMTP_HOST: $JENKINS_SMTP_HOST
<<: *common-env
links:
Expand Down
8 changes: 8 additions & 0 deletions env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ export JCASC_EXTRA_DIRS="./jcasc_extra_example"
#
#export JENKINS_DEFAULT_PAVICS_HOST="pavics.ouranos.ca"

# Set DEFAULT_CONFIG_PARAMETERS_SCRIPT_URL to configure default override.
#
# Default: none.
#
# Example: https://raw.githubusercontent.com/Ouranosinc/PAVICS-e2e-workflow-tests/refs/heads/master/test-override/jenkins-params-default.include.sh
#
#export DEFAULT_CONFIG_PARAMETERS_SCRIPT_URL=""

# STMP server for Jenkins to send email. See jcasc_ouranos/smtp.yaml for
# sample config.
#
Expand Down
2 changes: 2 additions & 0 deletions jcasc/global_env_var.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ jenkins:
value: ${ENABLE_SCHEDULED_TRIGGER} # Env var from env.local
- key: DEFAULT_PAVICS_HOST
value: ${DEFAULT_PAVICS_HOST} # Env var from env.local
- key: DEFAULT_CONFIG_PARAMETERS_SCRIPT_URL
value: ${DEFAULT_CONFIG_PARAMETERS_SCRIPT_URL} # Env var from env.local


# vi: tabstop=8 expandtab shiftwidth=2 softtabstop=2
40 changes: 40 additions & 0 deletions jcasc_ouranos/staging_jobs.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
jobs:
- script: >
folder('ouranos-staging')

- script: >
pipelineJob('ouranos-staging/medus.ouranos.ca') {
//
Expand Down Expand Up @@ -54,5 +55,44 @@ jobs:
}
}

- script: >
pipelineJob('ouranos-staging/test-rook') {
description('Test roocs/rook repo. ')
definition {
cpsScm {
scriptPath 'Jenkinsfile'
scm {
git {
remote {
url('https://github.com/Ouranosinc/PAVICS-e2e-workflow-tests.git')
}
branch('master')
extensions {
cleanAfterCheckout()
}
}
}
lightweight true
}
}

environmentVariables {
// This section requires the envinject plugin.
// It is known that envinject do not work properly with pipeline.
// "These EnvVars are being injected to the script environment and
// will be inaccessible via the "env" Pipeline global variable"

// Can not use DEFAULT_CONFIG_PARAMETERS_SCRIPT_URL because it seems
// we can not override global env var.
env('CI_OVERRIDE_CONFIG_PARAMETERS_SCRIPT_URL', 'https://raw.githubusercontent.com/Ouranosinc/PAVICS-e2e-workflow-tests/refs/heads/master/test-override/jenkins-params-external-repos.include.sh')
}

triggers {
// Same cron as in Jenkinsfile but need to "seed" it here for first build to run.
// Settings in Jenkinsfiles will only apply after first build.
//cron('@midnight')
}
}


# vi: tabstop=8 expandtab shiftwidth=2 softtabstop=2