-
-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathJenkinsfile_updatecli
More file actions
24 lines (24 loc) · 1.05 KB
/
Copy pathJenkinsfile_updatecli
File metadata and controls
24 lines (24 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
node('jnlp-linux-arm64') {
timeout(time: 30, unit: 'MINUTES') {
withCredentials([
azureServicePrincipal('updatecli-azure-serviceprincipal'), // needed for Azure login
usernamePassword(
credentialsId: 'github-app-updatecli-on-jenkins-infra', // needed for updatecli
usernameVariable: 'USERNAME_VALUE',
passwordVariable: 'UPDATECLI_GITHUB_TOKEN'
)
]) {
// Preliminary Azure login steps
sh 'az login --service-principal -u "$AZURE_CLIENT_ID" -p "$AZURE_CLIENT_SECRET" -t "$AZURE_TENANT_ID"'
sh 'az account set -s "$AZURE_SUBSCRIPTION_ID"'
final String updatecliAction = env.BRANCH_IS_PRIMARY ? 'apply' : 'diff'
stage("Run updatecli action: ${updatecliAction}") {
updatecli(
action: updatecliAction,
runInCurrentAgent: true,
cronTriggerExpression: env.BRANCH_IS_PRIMARY ? 'H/30 * * * *' : '',
)
}
}
}
}