-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
53 lines (53 loc) · 2.26 KB
/
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
49
50
51
52
53
pipeline {
agent any
stages {
stage('01. SCM dev branch checkout') {
steps{
ansiColor('xterm') {
git url: "[email protected]:neema80/cmp7221-cwk.git", credentialsId: 'jenkins_ssh_key', branch: 'dev'
}
}
}
stage('02. UNIT TESTING: Playbook 00 Sanity Check') {
steps{
ansiColor('xterm') {
ansiblePlaybook colorized: true, disableHostKeyChecking: true, forks: 1, installation: 'Ansible', inventory: 'hosts', playbook: '00_cwk_play.yml', extras: '--syntax-check'
ansiblePlaybook colorized: true, disableHostKeyChecking: true, forks: 1, installation: 'Ansible', inventory: 'hosts', playbook: '00_cwk_play.yml', extras: '--check'
}
}
}
stage('03. GNS3 APPLICATION') {
steps{
ansiColor('xterm') {
ansiblePlaybook colorized: true, disableHostKeyChecking: true, forks: 1, installation: 'Ansible', inventory: 'hosts', playbook: '00_cwk_play.yml' }
}
}
stage('04. INTEGRATION TESTING: Playbook 01') {
steps{
ansiColor('xterm') {
ansiblePlaybook colorized: true, disableHostKeyChecking: true, forks: 1, installation: 'Ansible', inventory: 'hosts', playbook: '01_test.yml' }
}
}
stage('05. SAVE GNS CONFIG: Playbook 02') {
steps{
ansiColor('xterm') {
ansiblePlaybook colorized: true, disableHostKeyChecking: true, forks: 1, installation: 'Ansible', inventory: 'hosts', playbook: '02_save_config_and_copy.yml' }
}
}
stage('06. DELIVERY: Merge Main branch') {
steps{
ansiColor('xterm') {
sh '''
git config user.name "Nima Bahramzadeh"
git config user.email "[email protected]"
git checkout main
git pull
git remote -v
git merge dev main
git push --set-upstream origin main
git status
'''}
}
}
}
}