Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (33 sloc) 882 Bytes
pipeline {
agent {
docker {
image 'registry.jeroensteenbeeke.nl/jekyll-builder:latest'
label 'docker'
args '-u root'
}
}
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
disableConcurrentBuilds()
}
stages {
stage('Build') {
steps {
sh 'bundle update'
sh 'bundle exec jekyll build'
}
}
stage('Publish') {
steps {
withCredentials([sshUserPrivateKey(credentialsId: 'jekyll-deploy-key', keyFileVariable: 'sshKeyFile')]) {
sh 'mkdir -p $HOME/.ssh'
sh 'cp '+ sshKeyFile +' $HOME/.ssh/id_rsa'
sh 'echo host 23.94.72.113 > $HOME/.ssh/config'
sh 'echo "\tStrictHostKeyChecking no" >> $HOME/.ssh/config'
sh 'chmod 0400 $HOME/.ssh/config'
sh 'rsync --delete -r _site/ deploy@23.94.72.113:/home/deploy/_site/'
}
}
}
}
}
You can’t perform that action at this time.