-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjenkinsfile
56 lines (53 loc) · 1.88 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
def gs // define a variable for the external groovy script (gs.groovy)
pipeline{
agent any
environment {
VERSION = "2.0"
REPOSITRY = "https://github.com/hamdiz0/vote-app.git"
}
stages{
stage("load-script"){
steps{
script{
gs = load "gs.groovy"
}
}
}
stage("build-vote-image"){
steps{
script{
gs.build('hamdiz0/va-vote',env.VERSION,'docker-repo','./vote') // calling the build function from the external script
}
}
}
stage("build-result-image"){
steps{
script{
gs.build('hamdiz0/va-result',env.VERSION,'docker-repo','./result')
}
}
}
stage("build-worker-image"){
steps{
script{
gs.build('hamdiz0/va-worker',env.VERSION,'docker-repo','./worker')
}
}
}
stage("deploy app"){
steps{
script {
gs.deploy(
'ubuntu', // remote user name
'51.44.12.190', // Ip address of the remote machine
env.VERSION , // version
'minikube-instance', // credentail Id in jenkins
env.REPOSITRY , // git repositry
'vote-app/k8s-specifications/', // Repo_Name/Path/
'minikube-run.sh' // Deployment_Script_Name
)
}
}
}
}
}