-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
59 lines (53 loc) · 1.45 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 {
agent any
options {
skipStagesAfterUnstable()
}
stages {
stage('Clone repository') {
steps {
script{
checkout scm
}
}
}
stage('Build') {
steps {
script{
app = docker.build("bc-express-app")
}
}
}
stage('Tag') {
steps {
script{
app.tag('jenkinstest')
}
}
}
stage('Push') {
steps {
script{
docker.withRegistry('https://860371349641.dkr.ecr.us-west-2.amazonaws.com/bc-express-app', 'ecr:us-west-2:awsCred') {
app.push("${env.BUILD_NUMBER}")
app.push("latest2")
}
}
}
}
stage('Deploy'){
steps {
sh 'kubectl apply -f deployment.yml'
}
}
stage("Using curl") {
steps {
script {
final String url = "adc1830dd0d7747e2917788baf46f4e1-1639727320.us-west-2.elb.amazonaws.com:3000/api/health"
final String response = sh(script: "curl -s $url", returnStdout: true).trim()
echo response
}
}
}
}
}