This repository was archived by the owner on Jan 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathJenkinsfile
More file actions
55 lines (46 loc) · 1.3 KB
/
Jenkinsfile
File metadata and controls
55 lines (46 loc) · 1.3 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!groovy
@Library("ace") _
import no.ace.Terraform
properties([disableConcurrentBuilds()])
Map opts = [
agent: 'jenkins-docker-3',
dockerSet: false,
]
Boolean isMaster = "${env.BRANCH_NAME}" == 'master'
Boolean isPR = "${env.CHANGE_URL}".contains('/pull/')
ace(opts) {
String helmImage = "lachlanevenson/k8s-helm:v2.14.1"
String helmArgs = ["--entrypoint=''", "-e HELM_HOME=${env.WORKSPACE}"].join(" ")
stage('helm init') {
docker.image(helmImage).inside(helmArgs) {
sh "helm init --client-only"
}
}
stage('terraform') {
Map tfOpts = [
dockerImage: 'evryace/helm-kubectl-terraform:2.14.1__1.13.7__0.12.6',
provider: 'azure',
path: 'terraform',
extraCreds: [
[id: 'azure_subscription_id'],
[id: 'azure_tenant_id'],
[id: 'azure_resource_group'],
[id: 'azure_location'],
[id: 'azure_client_id'],
[id: 'azure_client_secret'],
//[id: 'aks_ssh_public_key'],
[id: 'aks_ingress_ip'],
[id: 'aks_ingress_dns_name'],
[id: 'aks_rbac_client_app_id'],
[id: 'aks_rbac_server_app_id'],
[id: 'aks_rbac_server_app_secret'],
[id: 'aks_rbac_cluster_admins_group_id'],
[id: 'user_id'],
],
]
terraform('default', tfOpts) {
lint()
plan()
}
}
}