-
Notifications
You must be signed in to change notification settings - Fork 0
/
jenkinsfile
34 lines (29 loc) · 1.72 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-shangxian.app.git']]]
// }
// }
stage('Sync html') {
steps {
sshPublisher(publishers: [sshPublisherDesc(configName: 'sg02', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: 'echo "sync success"', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: "$WWWROOT_DIR/shangxian.app", remoteDirectorySDF: false, removePrefix: 'html', sourceFiles: 'html/**/*')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: true)])
}
}
stage('Reload nginx') {
steps {
sh "mv nginx.conf 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: 'shangxian.app.conf')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: true)])
}
}
}
post {
always {
deleteDir()
}
}
}