forked from CSID-DGU/2023-2-OSSPrac-Raccoon-11
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPipelinescript.txt
50 lines (41 loc) ยท 1.06 KB
/
Pipelinescript.txt
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
pipeline {
agent any
triggers {
pollSCM('*/3 * * * *')
}
environment {
DOCKER = credentials('dockerhub')
}
stages {
stage('Prepare') {
agent any
steps {
git url : 'https://github.com/CSID-DGU/2023-2-OSSPrac-Raccoon-11.git',
branch : 'main',
credentialsId: 'github'
}
}
stage('Build') {
steps {
dir('/var/jenkins_home/workspace/hw6_c'){
sh 'docker compose build web'
}
}
}
stage('Tag') {
steps {
script {
sh "docker tag ${DOCKER_USR}/flask ${DOCKER_USR}/flask:${BUILD_NUMBER}"
}
}
}
stage('Push') {
steps {
script {
sh "docker login -u $DOCKER_USR -p $DOCKER_PSW"
sh "docker push ${DOCKER_USR}/flask:${BUILD_NUMBER}"
}
}
}
}
}