-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
52 lines (47 loc) · 1.49 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
pipeline {
agent any
stages {
stage('Pull') {
steps{
script{
checkout([$class: 'GitSCM',
branches: [[name: '*/master']],
extensions: [[$class: 'CloneOption', timeout: 120]],
userRemoteConfigs: [[
credentialsId: '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',
url: 'https://github.com/Raedaatwi/MyApp.git']]])
}
}
}
/*
stage('Install') {
steps{
script{
sh "sudo npm install"
}
}
}
*/
stage('Build') {
steps{
script{
sh " ansible-playbook ansible/build.yml -i ansible/inventory/host.yml --private-key=/var/lib/jenkins/.ssh/id_rsa -u root"
}
}
}
stage('Docker'){
steps{
script{
sh "ansible-playbook ansible/docker.yml -i ansible/inventory/host.yml --private-key=/var/lib/jenkins/.ssh/id_rsa -u root"
}
}
}
stage('dockerHub') {
steps{
script{
sh "ansible-playbook ansible/registry.yml -i ansible/inventory/host.yml --private-key=/var/lib/jenkins/.ssh/id_rsa -u root"
}
}
}
}
}