-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
35 lines (34 loc) · 995 Bytes
/
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
pipeline {
agent any
tools {
nodejs 'NodeJS'
}
stages {
stage('Build Frontend') {
steps {
sh 'echo "Testing"'
}
}
stage('Push to ECR') {
steps {
script {
sh 'aws ecr get-login-password --region eu-west-2 | docker login --username AWS --password-stdin 655093420076.dkr.ecr.eu-west-2.amazonaws.com'
sh 'docker build -t impc-nextjs-frontend .'
sh 'docker tag impc-nextjs-frontend:latest 655093420076.dkr.ecr.eu-west-2.amazonaws.com/impc-nextjs-frontend:latest'
sh 'docker push 655093420076.dkr.ecr.eu-west-2.amazonaws.com/impc-nextjs-frontend:latest'
}
}
}
stage('Redeploy in Kubernetes') {
steps {
script {
sh 'kubectl get pods -o wide'
sh 'kubectl delete deploy impc-nextjs-frontend'
sh 'kubectl apply -f impc-nextjs-frontend-deployment.yaml'
sleep 3
sh 'kubectl get pods -o wide'
}
}
}
}
}