jenkinsfile: refactor deploy-website task into shared-library
@@ -153,7 +153,7 @@ def main() {
maybeStage("Deploy Website", isMaster()) {
milestone label: "Deploy Website"
- deployWebsite()
+ parallel deployWebsite()
}
// maybeStage("Deploy Web UI", isMaster()) {
@@ -1213,47 +1213,18 @@ def deployDockerContainer(name, imageDesc, hostName) {
}
}
-def deployWebsite() {
- withDockerEnv(DOCKER_IMAGES.website) {
- sh "ls -al /usr/local/share/elektra/tool_data/website/public/"
- sh "cp -Rf /usr/local/share/elektra/tool_data/website ."
- sshPublisher(
- publishers: [
- sshPublisherDesc(
- verbose: true,
- configName: 'doc.libelektra.org',
- transfers: [
- sshTransfer(
- execCommand: 'rm -Rf /srv/libelektra/website/public_old; cp -Rfpv /srv/libelektra/website/public /srv/libelektra/website/public_old'
- )
- ]
- )
- ]
- )
- sshPublisher(
- publishers: [
- sshPublisherDesc(
- verbose: true,
- configName: 'doc.libelektra.org',
- transfers: [
- sshTransfer(
- sourceFiles: 'website/public/**/*',
- removePrefix: 'website',
- remoteDirectory: 'website'
- )
- ]
- )
- ]
- )
- }
-}
-
def buildWebsite() {
def websiteTasks = [:]
websiteTasks << dockerUtils.buildImageStage(DOCKER_IMAGES.website)
return websiteTasks
}
+def deployWebsite() {
+ def deployTasks = [:]
+ deployTasks << release.deployWebsite(DOCKER_IMAGES.website)
+ return deployTasks
+}
+
def deployWebUI() {
deployDockerContainer(
"elektrad",
