-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
48 lines (37 loc) · 918 Bytes
/
Jenkinsfile
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
node ('master') {
try {
String ANSI_GREEN = "\u001B[32m"
String ANSI_NORMAL = "\u001B[0m"
String ANSI_BOLD = "\u001B[1m"
String ANSI_RED = "\u001B[31m"
String ANSI_YELLOW = "\u001B[33m"
ansiColor('xterm') {
stage('checkout') {
cleanWs()
checkout scm
}
stage('test') {
sh 'echo $my_home'
sh 'env > env.txt'
sh 'cat env.txt'
}
stage('shellscript'){
sh 'ansible-vault view passwd.yml --vault-password-file=secrets'
}
stage('ansible-test') {
sh 'ansible-playbook --vault-id /home/hari/ansible/testpro/secrets /home/hari/ansible/testpro/testdir.yml'
}
stage('colour') {
ansiblePlaybook(
playbook: '/home/hari/ansible/testpro/testdir.yml',
extras: '--vault-id /home/hari/ansible/testpro/secrets',
colorized: true)
}
}
}
catch (err) {
currentBuild.result = "FAILURE"
throw err
}
}