forked from profebass99/jenkins-terraform-eks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
71 lines (70 loc) · 1.59 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
60
61
62
63
64
65
66
67
68
69
70
71
def gv
pipeline {
agent any
environment {
awsEcrCreds = 'ecr:us-east-2:**********'
awsEcrRegistry = "*******.dkr.ecr.us-east-2.amazonaws.com/*******"
imageRegUrl = "https://**********.dkr.ecr.us-east-2.amazonaws.com"
awsRegion = "us-east-2"
}
tools {
maven "MAVEN3"
jdk "OracleJDK8"
}
stages {
stage ("init") {
steps {
script {
gv = load "script.groovy"
}
}
}
stage ("Fetch Code") {
steps {
script {
gv.fetchCode()
}
}
}
stage ('Build') {
steps {
script {
gv.buildCode()
}
}
post {
success {
archiveArtifacts artifacts: '**/*.war'
}
}
}
stage ('Build Image') {
steps {
script {
gv.buildImage()
}
}
}
stage ('Push Image to ECR') {
steps {
script {
gv.pushImage()
}
}
}
stage ('provision eks cluster') {
steps {
script {
gv.provisionEksCluster()
}
}
}
stage ('connect to eks cluster') {
steps {
script {
gv.connectEks()
}
}
}
}
}