-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker_build
48 lines (47 loc) · 1.2 KB
/
docker_build
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
#!groovy
properties([disableConcurrentBuilds()])
pipeline {
agent {
label 'terraform'
}
options {
buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10'))
timestamps()
}
stages {
stage("Get code") {
when {
environment name: 'BUILD_NUMBER', value: '1'
}
steps {
sh "git clone https://github.com/hippiuS/test_django.git app/"
}
}
stage("Update code") {
when {
not {
environment name: 'BUILD_NUMBER', value: '1'
}
}
steps {
dir('app/') {
sh "git pull"
}
}
}
stage("Network step") {
steps {
dir('app/terraform/network/') {
sh 'terraform init && terraform apply -auto-approve'
}
}
}
stage("app step") {
steps {
dir('app/terraform/') {
sh 'terraform init && terraform apply -auto-approve'
}
}
}
}
}