-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
49 lines (41 loc) · 1.52 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
node ('nimble-jenkins-slave') {
stage('Download Latest') {
git(url: 'https://github.com/nimble-platform/data_pipes.git', branch: env.BRANCH_NAME)
}
stage('Build Java') {
sh 'mvn clean install -DskipTests'
}
if (env.BRANCH_NAME == 'staging') {
stage('Build Docker') {
sh 'docker build -t nimbleplatform/data-pipes:staging .'
}
stage('Push Docker') {
sh 'docker push nimbleplatform/data-pipes:staging'
}
stage('Deploy') {
sh 'ssh staging "cd /srv/nimble-staging/ && ./run-staging.sh restart-single identity-service"' // ToDo: implement
}
}
if (env.BRANCH_NAME == 'master') {
stage('Build Docker') {
sh 'docker build -t nimbleplatform/data-pipes:latest .'
}
stage('Push Docker') {
sh 'docker push nimbleplatform/data-pipes:latest'
}
stage('Deploy') {
sh 'ssh nimble "cd /data/deployment_setup/prod/ && sudo ./run-prod.sh restart-single data-pipes"'
}
}
// Kubernetes deployment is disabled for the time being
// stage ('Deploy') {
// sh ''' sed -i 's/IMAGE_TAG/'"$BUILD_NUMBER"'/g' kubernetes/deploy.yaml '''
// sh 'kubectl apply -f kubernetes/deploy.yaml -n prod --validate=false'
// sh 'kubectl apply -f kubernetes/svc.yaml -n prod --validate=false'
// }
//
// stage ('Print-deploy logs') {
// sh 'sleep 60'
// sh 'kubectl -n prod logs deploy/data-channels -c data-channels'
// }
}