-
Notifications
You must be signed in to change notification settings - Fork 5
/
Jenkinsfile
41 lines (41 loc) · 1.69 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
pipeline {
agent any
parameters {
choice(name: 'SERVER', choices: ['DEV', 'STAGE', 'PROD'], description: 'Server')
}
stages {
stage('Deploy to Dev') {
when {
expression { params.SERVER == 'DEV' }
}
steps {
echo 'deply to dev'
sshagent(credentials: ['a4d999a5-6318-4659-83be-3f148a5490ca']) {
sh 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/juno/work/ci/jenkins/known_hosts [email protected] "cd /srv/services/beagle_dev/beagle && source /juno/work/ci/jenkins/lsf.sh && git pull && git checkout $BRANCH_NAME && source run_restart.sh"'
}
}
}
stage('Deploy to Stage') {
when {
expression { params.SERVER == 'STAGE' }
}
steps {
echo 'deply to stage'
sshagent(credentials: ['a4d999a5-6318-4659-83be-3f148a5490ca']) {
sh 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/juno/work/ci/jenkins/known_hosts [email protected] "cd /srv/services/staging_voyager/beagle/code/beagle && source /juno/work/ci/jenkins/lsf.sh && git pull && git checkout $BRANCH_NAME && cd ../.. && source run_restart.sh"'
}
}
}
stage('Deploy to Prod') {
when {
expression { params.SERVER == 'PROD' }
}
steps {
echo 'deply to PROD'
sshagent(credentials: ['a4d999a5-6318-4659-83be-3f148a5490ca']) {
sh 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/juno/work/ci/jenkins/known_hosts [email protected] "cd /srv/services/beagle/code/beagle && source /juno/work/ci/jenkins/lsf.sh && git pull && git checkout $BRANCH_NAME && cd ../.. && source run_restart.sh"'
}
}
}
}
}