Deploy Documentation on condition
Some checks failed
Gitsokyo/bot-base/pipeline/pr-master There was a failure building this commit

This commit is contained in:
Suwako Moriya 2020-04-26 21:02:47 +02:00
parent a59e480f85
commit 3cd86f728b
Signed by: SuwakoMmh
GPG Key ID: A27482B806F13CD5

32
Jenkinsfile vendored
View File

@ -45,15 +45,33 @@ pipeline {
} }
stage('Deploy Documentation') { stage('Deploy Documentation') {
when {
anyOf {
branch 'stable'
branch 'unstable'
tag
}
}
steps { steps {
sshagent(credentials: ['1cf72f47-b70c-4f90-a958-020956099d19']) { sshagent(credentials: ['1cf72f47-b70c-4f90-a958-020956099d19']) {
sh '''cd doc scipt {
rm -f rsync.log SUB_PATH="""${sh(
ssh -o StrictHostKeyChecking=no -o BatchMode=yes ${DEPLOY_HOST} mkdir -p ${DEPLOY_PATH}${GIT_BRANCH#*/}/ returnStdout: true,
rsync -aze 'ssh -o StrictHostKeyChecking=no -o BatchMode=yes' \ script: 'echo "${GIT_BRANCH#*/}"'
--log-file=rsync.log \ )}""".trim()
--delete \ if (tag) {
./build/html/ ${DEPLOY_HOST}:${DEPLOY_PATH}${GIT_BRANCH#*/}/''' SUB_PATH="${env.TAG_NAME}"
}
withEnv(["SUB_PATH=${SUB_PATH}"]) {
sh '''cd doc
rm -f rsync.log
ssh -o StrictHostKeyChecking=no -o BatchMode=yes ${DEPLOY_HOST} mkdir -p ${DEPLOY_PATH}${SUB_PATH}/
rsync -aze 'ssh -o StrictHostKeyChecking=no -o BatchMode=yes' \
--log-file=rsync.log \
--delete \
./build/html/ ${DEPLOY_HOST}:${DEPLOY_PATH}${SUB_PATH}/'''
}
}
} }
} }
post { post {