-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathJenkinsfile-prod
50 lines (44 loc) · 1.22 KB
/
Jenkinsfile-prod
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
pipeline {
agent any
stages{
stage ('checkout') {
steps {
git branch: 'main', url: 'https://github.com/Sunbird-Saral/Project-Saral.git'
}
}
stage ('docker_image_build'){
steps {
sh 'chmod +x ./build_image.sh'
sh './build_image.sh'
}
}
stage('Pull Docker Image') {
steps {
script {
docker.withRegistry('https://registry.hub.docker.com', 'dockerhub_credentials') {
def dockerImage = docker.image('saaral123/backendapi:2.0')
dockerImage.pull()
}
}
}
}
stage ('deploy to EKS'){
steps{
sh 'export KUBECONFIG=/var/lib/jenkins/.kube/config'
sh 'chmod +x ./deploy_EKS.sh'
sh './deploy_EKS.sh'
}
}
stage('SonarQube analysis') {
steps{
withSonarQubeEnv('saralsonar9.0.1') {
sh '''
cd v1.0/backend/
npm install
npm run sonar
'''
}
}
}
}
}