forked from mgsgoms/Docker-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
59 lines (51 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
pipeline {
environment {
registry = "10.128.0.2:5000/mgsgoms/flask"
registry_mysql = "10.128.0.2:5000/mgsgoms/mysql"
dockerImage = ""
}
agent any
stages {
stage('Checkout Source') {
steps {
git 'https://github.com/mgsgoms/Docker-Project.git'
}
}
stage('Build image') {
steps{
script {
dockerImage = docker.build registry + ":$BUILD_NUMBER"
}
}
}
stage('Push Image') {
steps{
script {
docker.withRegistry( "" ) {
dockerImage.push()
}
}
}
}
stage('current') {
steps{
dir("${env.WORKSPACE}/mysql"){
sh "pwd"
}
}
}
stage('Build mysql image') {
steps{
sh 'docker build -t "10.128.0.2:5000/mgsgoms/mysql:$BUILD_NUMBER" "$WORKSPACE"/mysql'
sh 'docker push "10.128.0.2:5000/mgsgoms/mysql:$BUILD_NUMBER"'
}
}
stage('Deploy App') {
steps {
script {
kubernetesDeploy(configs: "frontend.yaml", kubeconfigId: "kube")
}
}
}
}
}