Skip to content

Commit

Permalink
Merge pull request #113 from lemeurherve/helpdesk2778-separate-update…
Browse files Browse the repository at this point in the history
…cli-to-its-own-pipeline

chore: separate updatecli to its own pipeline
  • Loading branch information
dduportal authored Dec 23, 2024
2 parents 6bf4e3b + 43d81a5 commit 62657fb
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 25 deletions.
39 changes: 17 additions & 22 deletions Jenkinsfile_k8s
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
parallel(
failFast: false,
'terraform': {
terraform(
// "Read only" token
stagingCredentials: [
string(variable: 'FASTLY_API_KEY', credentialsId:'staging-terraform-fastly-api-key'),
file(variable: 'BACKEND_CONFIG_FILE', credentialsId: 'staging-terraform-fastly-backend-config'),
],
// "Read write" token
productionCredentials: [
string(variable: 'FASTLY_API_KEY', credentialsId:'production-terraform-fastly-api-key'),
file(variable: 'BACKEND_CONFIG_FILE', credentialsId: 'production-terraform-fastly-backend-config'),
],
)
},
'updatecli': {
updatecli(action: 'diff')
if (env.BRANCH_IS_PRIMARY) {
updatecli(action: 'apply', cronTriggerExpression: '@daily')
}
},
if (env.BRANCH_IS_PRIMARY) {
// Only trigger a daily check on the principal branch
properties([pipelineTriggers([cron('@daily')])])
}

terraform(
// "Read only" token
stagingCredentials: [
string(variable: 'FASTLY_API_KEY', credentialsId:'staging-terraform-fastly-api-key'),
file(variable: 'BACKEND_CONFIG_FILE', credentialsId: 'staging-terraform-fastly-backend-config'),
],
// "Read write" token
productionCredentials: [
string(variable: 'FASTLY_API_KEY', credentialsId:'production-terraform-fastly-api-key'),
file(variable: 'BACKEND_CONFIG_FILE', credentialsId: 'production-terraform-fastly-backend-config'),
],
// publishReports: ['jenkins-infra-data-reports/fastly.json'],
)
7 changes: 7 additions & 0 deletions Jenkinsfile_updatecli
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
updatecli(action: 'diff')

if (env.BRANCH_IS_PRIMARY) {
// Only trigger a daily check on the principal branch
properties([pipelineTriggers([cron('@daily')])])
updatecli(action: 'apply')
}
6 changes: 3 additions & 3 deletions updatecli/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
github:
user: "Jenkins Infra Bot (updatecli)"
email: "[email protected]"
username: "jenkins-infra-bot"
user: "jenkins-infra-updatecli"
email: "178728+jenkins-infra-updatecli[bot]@users.noreply.github.com"
token: "UPDATECLI_GITHUB_TOKEN"
branch: "main"
owner: "jenkins-infra"
Expand Down

0 comments on commit 62657fb

Please sign in to comment.