-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
27 lines (26 loc) · 790 Bytes
/
Jenkinsfile
File metadata and controls
27 lines (26 loc) · 790 Bytes
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
pipeline {
agent any
parameters {
string(name: 'Project', description: 'what is the name of the department for which task is needed?')
choice(name: 'tag', choices: ['Run', 'Stop'], description: 'Choose whether to create or delete')
}
environment {
project = "${params.Project}"
tag = "${params.tag}"
}
stages {
stage('build') {
agent {
docker {
image 'faizu6/ansible-img1:2'
args "--user root --privileged"
}
}
steps {
sh '''
ansible-playbook main.yml -e name=$Project --tag $tag
'''
}
}
}
}