-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjenkinsfile
34 lines (29 loc) · 1.82 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
options {
timestamps()
}
stages {
// stage('Clone') {
// steps {
// checkout changelog: false, poll: false, scm: [$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'shangxianapp-github-xuexb-ssh-key', url: '[email protected]:shangxianapp/docker-netdata.shangxian.app.git']]]
// }
// }
stage('Deploy Docker') {
steps {
sshPublisher(publishers: [sshPublisherDesc(configName: 'sg02', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: "cd $WWWROOT_DIR/netdata.shangxian.app && docker-compose up -d --force-recreate", execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: "$WWWROOT_DIR/netdata.shangxian.app", remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'docker-compose.yml')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: true)])
}
}
stage('Reload nginx') {
steps {
sh "mv nginx.conf netdata.shangxian.app.conf"
sshPublisher(publishers: [sshPublisherDesc(configName: 'sg02', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: "/bin/sh $DOCKER_NGINX_DIR/reload.sh", execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: "$DOCKER_NGINX_VHOST_DIR", remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'netdata.shangxian.app.conf')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: true)])
}
}
}
post {
always {
deleteDir()
}
}
}