-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
36 lines (32 loc) · 1.09 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
pipeline {
agent any
stages {
stage('Chekout'){
steps {
git branch: 'main', url: "[email protected]:top-secrett/ansible.git", credentialsId: 'github-ssh-key'
}
}
stage('Deploy') {
steps {
ansiblePlaybook playbook: 'playbook.yml', inventory: 'hosts.txt', credentialsId: 'github-ssh-key'
}
}
stage('git diff'){
steps {
sh 'git diff $GIT_PREVIOUS_COMMIT'
}
}
stage('Checkout') {
steps {
git branch: 'main', url: "[email protected]:top-secrett/ansible.git", credentialsId: 'github-ssh-key'
// lastChanges since: 'LAST_SUCCESSFUL_BUILD', format:'SIDE',matching: 'LINE'
echo "${GIT_COMMIT}"
echo "${GIT_PREVIOUS_SUCCESSFUL_COMMIT}"
sh '''
#!/bin/bash
git diff --name-status "${GIT_PREVIOUS_SUCCESSFUL_COMMIT}" "${GIT_COMMIT}"
'''
}
}
}
}