forked from RAHAMSHAIK007/dockernewproject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPIPELINE CODES (PUSH, DEP)
49 lines (43 loc) · 949 Bytes
/
PIPELINE CODES (PUSH, DEP)
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
PUSHING:
pipeline {
agent any
stages {
stage('checkout') {
steps {
git 'https://github.com/RAHAMSHAIK007/dockernewproject.git'
}
}
stage('build') {
steps {
sh 'docker build -t $img .'
}
}
stage('tag') {
steps {
sh 'docker tag $img $repo'
}
}
stage('push') {
steps {
sh 'docker login -u rahamshaik -p Raham@#123'
sh 'docker push $repo'
}
}
}
}
DEPLOYMENT:
pipeline {
agent any
stages {
stage('check') {
steps {
git 'https://github.com/RAHAMSHAIK007/dockernewproject.git'
}
}
stage('stack') {
steps {
sh 'docker stack deploy -c docker-compose.yml courses'
}
}
}
}