-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile.configure_infra
More file actions
44 lines (40 loc) · 1.71 KB
/
Jenkinsfile.configure_infra
File metadata and controls
44 lines (40 loc) · 1.71 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
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '300'))
ansiColor('xterm') /* This requires AnsiColor plugin */
}
stages {
stage('Configure FortiSASE') {
steps {
script {
withCredentials([usernamePassword(credentialsId: 'fortisase-creds',
usernameVariable: 'TF_USER',
passwordVariable: 'TF_PASS')]) {
sh '''
##########
########## Note this is just for using an internal build. For regular releases please skip this block
version=1.1.0
os_arch="linux_amd64"
mkdir -p ~/.terraform.d/plugins/fortinet.com/fortinetdev/fortisase/$version/$os_arch
cp /opt/terraform-provider-fortisase ~/.terraform.d/plugins/fortinet.com/fortinetdev/fortisase/$version/$os_arch
chmod 755 ~/.terraform.d/plugins/fortinet.com/fortinetdev/fortisase/$version/$os_arch/terraform-provider-fortisase
##########
##########
export TF_VAR_username=$TF_USER
export TF_VAR_password=$TF_PASS
terraform init
terraform apply -auto-approve
'''
}
}
}
}
}
post {
always {
archiveArtifacts artifacts: '**/*',
allowEmptyArchive: true
}
}
}