-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
29 lines (23 loc) · 1.03 KB
/
Jenkinsfile
File metadata and controls
29 lines (23 loc) · 1.03 KB
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
#!/usr/bin/env groovy
node('robxtask-jenkins-slave') {
// -----------------------------------------------
// --------------- Staging Branch ----------------
// -----------------------------------------------
if (env.BRANCH_NAME == 'staging') {
stage('Clone and Update') {
git(url: 'https://github.com/ROBxTASK/codegen-service.git', branch: env.BRANCH_NAME)
}
stage('Build Docker') {
sh 'docker build ./server -t robxtask/codegen-service:staging'
}
stage('Push Docker - staging') {
withCredentials([usernamePassword(credentialsId: 'docker-login-credentials', usernameVariable: 'USER', passwordVariable: 'PASS')]) {
sh 'docker login --username $USER --password $PASS'
sh 'docker push robxtask/codegen-service:staging'
}
}
stage('Deploy') {
sh 'ssh staging "cd /srv/docker-setup/staging/ && ./run-staging.sh restart-single codegen-service"'
}
}
}