-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
49 lines (48 loc) · 1.54 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
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'export JAVA_HOME="/opt/jdk1.8.0_171/" && cd java-app && mvn clean package'
}
}
stage('Pack to Docker') {
steps {
sh 'docker build -t hello-world .'
}
}
stage('Docker Tests'){
steps {
sh 'GOSS_SLEEP=10 dgoss run hello-world'
}
}
stage('Publish Docker'){
steps {
sh 'eval $(aws ecr get-login --no-include-email --region us-west-2) && \
./version.sh && \
docker tag hello-world 467269547207.dkr.ecr.us-west-2.amazonaws.com/hello-world:$(cat version) && \
docker push 467269547207.dkr.ecr.us-west-2.amazonaws.com/hello-world:$(cat version)'
}
}
stage('Deploy to qal'){
steps {
sh 'export KUBECONFIG=$KUBECONFIG:~/.kube/config-cluster1 && kubectl apply -f k8s/deploy-qal.yml --record && kubectl rollout status deploy hello-world-deploy-qal'
}
}
stage('qal tests'){
steps {
sh 'tests/test-response.sh qal'
}
}
stage('Deploy Prod'){
steps {
sh 'export KUBECONFIG=$KUBECONFIG:~/.kube/config-cluster1 && kubectl apply -f k8s/deploy-prod.yml --record && kubectl rollout status deploy hello-world-deploy-prod'
}
}
stage('Production tests'){
steps {
sh 'tests/test-response.sh prod'
}
}
}
}