-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile_shell
74 lines (74 loc) · 2.16 KB
/
Jenkinsfile_shell
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
pipeline {
agent any
stages {
stage('Find Branch Name') {
steps {
echo "Found branch name of: ${env.BRANCH_NAME}"
}
}
stage('Refresh Tower DEV Project') {
when {
branch 'dev'
}
steps {
echo "Refreshing Tower DEV Project"
sh '''
/usr/bin/curl -X POST -u 'admin:r3dh4t!' 'https://tower.example.com/api/v2/projects/6/update/' -k
'''
}
}
stage('Refresh Dev Cloudforms Domain') {
when {
branch 'dev'
}
steps {
echo "Refreshing DEV Cloudforms Automate Domain"
sh '''
/usr/bin/curl -k -X POST -d'{"action":"refresh_from_source"}' -u admin:smartvm "https://cfme-cicd-dev.example.com/api/automate_domains/cloudforms-cicd"
'''
}
}
stage('Testing Dev VM Lifecycle') {
when {
branch 'dev'
}
steps {
echo "Testing VM Lifecycle"
sh './cfme-scripts/cfme-lifecycle-test.rb cfme-cicd-dev.example.com "admin:smartvm" "100000000000001"'
echo "Lifecycle Testing Complete"
}
}
stage('Refresh Production Tower Project') {
when {
branch 'master'
}
steps {
echo "Refreshing Production Tower Project"
sh '''
/usr/bin/curl -X POST -u 'admin:r3dh4t!' 'https://tower.example.com/api/v2/projects/9/update/' -k
'''
}
}
stage('Refresh Production Cloudforms Domain') {
when {
branch 'master'
}
steps {
echo "Refreshing Production Cloudforms Automate Domain"
sh '''
/usr/bin/curl -k -X POST -d'{"action":"refresh_from_source"}' -u admin:smartvm "https://cfme-cicd-prod.example.com/api/automate_domains/cloudforms-cicd"
'''
}
}
stage('Testing Prod VM Lifecycle') {
when {
branch 'master'
}
steps {
echo "Testing VM Lifecycle"
sh './cfme-scripts/cfme-lifecycle-test.rb cfme-cicd-prod.example.com "admin:smartvm" "101000000000001"'
echo "Lifecycle Testing Complete"
}
}
}
}