forked from tekdi/user-microservice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
34 lines (30 loc) · 1.36 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
pipeline {
agent any
stages {
stage('Checkout'){
steps{
cleanWs()
sh 'rm -rf *'
//checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: 'githubtoken', url: 'https://github.com/tekdi/onest.network.backend.git']])
// checkout scmGit(branches: [[name: '*/dev']], extensions: [], userRemoteConfigs: [[credentialsId: 'ONEST-ID', url: 'https://github.com/tekdi/onest.network.backend.git']])
checkout scmGit(branches: [[name: '*/Shiksha-2.0']], extensions: [], userRemoteConfigs: [[credentialsId: 'github-1', url: 'https://github.com/tekdi/shiksha-backend.git']])
}
}
stage ('Build-image') {
steps {
sh 'docker build -t shiksha-backend-2.0 .'
}
}
stage ('Deploy') {
steps {
sh 'docker-compose up -d --force-recreate --no-deps backend'
}
}
post {
stage ('Deploy') {
// Send notification to Slack
slackSend(channel: '#your_channel_name', color: 'good', message: "Build ${currentBuild.result}: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
}
}
}
}