This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 252
/
Jenkinsfile-acr-with-git
33 lines (33 loc) · 1.8 KB
/
Jenkinsfile-acr-with-git
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
node {
stage('build') {
acrQuickBuild azureCredentialsId: env.AZURE_CRED_ID,
resourceGroupName: env.ACR_RES_GROUP,
registryName: env.ACR_NAME,
platform: "Linux",
dockerfile: 'doc/resources/jenkins/DockerfileWithMaven',
gitBranch: '',
gitPath: '',
gitRepo: 'https://github.com/Microsoft/todo-app-java-on-azure',
imageNames: [[image: "$env.ACR_REGISTRY/$env.IMAGE_NAME:$env.BUILD_NUMBER"]],
sourceType: 'git',
buildArgs: [[key: 'dbUrl', secrecy: false, value: env.DOCUMENTDB_URI],
[key: 'dbKey', secrecy: true, value: env.DOCUMENTDB_KEY],
[key: 'dbName', secrecy: false, value: env.DOCUMENTDB_DBNAME]]
}
stage('deploy') {
sh 'wget https://raw.githubusercontent.com/Microsoft/todo-app-java-on-azure/master/doc/resources/jenkins/deployment.yml -O deployment.yml'
acsDeploy azureCredentialsId: env.AZURE_CRED_ID,
configFilePaths: 'deployment.yml',
containerRegistryCredentials: [[credentialsId: env.ACR_CREDENTIAL_ID, url: "http://$env.ACR_REGISTRY"]],
containerService: "$env.AKS_NAME | AKS",
enableConfigSubstitution: true,
resourceGroupName: env.AKS_RES_GROUP,
secretName: env.ACR_SECRET
sh 'wget https://raw.githubusercontent.com/Microsoft/todo-app-java-on-azure/master/doc/resources/jenkins/service.yml -O service.yml'
acsDeploy azureCredentialsId: env.AZURE_CRED_ID,
configFilePaths: 'service.yml',
containerService: "$env.AKS_NAME | AKS",
enableConfigSubstitution: true,
resourceGroupName: env.AKS_RES_GROUP
}
}