-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7815b23
commit 62da7c0
Showing
1 changed file
with
34 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,22 +11,21 @@ pipeline { | |
} | ||
} | ||
environment { | ||
DEPLOY_URL="https://strongbox.github.io" | ||
DEPLOY_URL = "https://strongbox.github.io" | ||
} | ||
options { | ||
timeout(time: 30, unit: 'MINUTES') | ||
disableConcurrentBuilds() | ||
} | ||
stages { | ||
stage('Node') | ||
{ | ||
stage('Node') { | ||
steps { | ||
container("mkdocs") { | ||
nodeInfo("python pip mkdocs") | ||
} | ||
} | ||
} | ||
stage('Building') | ||
{ | ||
stage('Building') { | ||
steps { | ||
container("mkdocs") { | ||
withCredentials([string(credentialsId: '3ea1e18a-b1d1-44e0-a1ff-7b62870913f8', variable: 'GOOGLE_ANALYTICS_KEY')]) { | ||
|
@@ -37,19 +36,43 @@ pipeline { | |
} | ||
stage('Deploying') { | ||
when { | ||
expression { BRANCH_NAME == 'master' && (currentBuild.result == null || currentBuild.result == 'SUCCESS') } | ||
expression { | ||
BRANCH_NAME == 'master' && (currentBuild.result == null || currentBuild.result == 'SUCCESS') | ||
} | ||
} | ||
steps { | ||
container("mkdocs") { | ||
configFileProvider([configFile(fileId: 'e0235d92-c2fc-4f81-ae4b-28943ed7350d', targetLocation: '/tmp/gh-pages.sh')]) { | ||
withCredentials([sshUserPrivateKey(credentialsId: '011f2a7d-2c94-48f5-92b9-c07fd817b4be', keyFileVariable: 'SSH_KEY', usernameVariable: 'SSH_USER')]) { | ||
withEnv(["GIT_SSH_COMMAND=ssh -o StrictHostKeyChecking=no -o User=${SSH_USER} -i ${SSH_KEY}"]) { | ||
sh "/bin/bash /tmp/gh-pages.sh" | ||
} | ||
withCredentials([sshUserPrivateKey(credentialsId: '011f2a7d-2c94-48f5-92b9-c07fd817b4be', keyFileVariable: 'SSH_KEY', usernameVariable: 'SSH_USER')]) { | ||
withEnv(["GIT_SSH_COMMAND=ssh -o StrictHostKeyChecking=no -o User=${SSH_USER} -i ${SSH_KEY}"]) { | ||
sh 'git checkout --orphan gh-pages' | ||
sh 'find . -maxdepth 1 ! -name "site" ! -name ".git*" ! -name "." -exec git rm -rf {} \\;' | ||
sh 'git add --force site' | ||
sh 'git commit -m "Updating documentation site."' | ||
sh 'git remote add strongbox.github.io [email protected]:strongbox/strongbox.github.io.git' | ||
sh 'git push strongbox.github.io `git subtree split --prefix site gh-pages`:master --force' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
post { | ||
failure { | ||
script { | ||
if (params.NOTIFY_EMAIL) | ||
{ | ||
notifyFailed((BRANCH_NAME == "master") ? notifyMaster : notifyBranch) | ||
} | ||
} | ||
} | ||
fixed { | ||
script { | ||
if (params.NOTIFY_EMAIL) | ||
{ | ||
notifyFixed((BRANCH_NAME == "master") ? notifyMaster : notifyBranch) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|