2020-10-10 07:15:24 +02:00
|
|
|
pipeline {
|
2020-10-10 08:57:28 +02:00
|
|
|
agent none
|
2020-10-10 08:27:53 +02:00
|
|
|
|
2020-10-10 07:15:24 +02:00
|
|
|
stages {
|
|
|
|
stage('Build') {
|
2020-10-10 08:07:55 +02:00
|
|
|
parallel {
|
|
|
|
stage('HTML') {
|
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
image 'silex/emacs:27.1-alpine-dev'
|
|
|
|
args '-u root --privileged'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
steps {
|
|
|
|
sh 'cask'
|
|
|
|
sh 'make html'
|
2020-10-10 08:57:49 +02:00
|
|
|
// Because we're running in root, the public/ directory
|
|
|
|
// isn't owned by the Jenkins user, meaning that
|
|
|
|
// unstashing in a different stage fails.
|
|
|
|
sh 'chown -R $(stat -c "%u" .):$(stat -c "%u" .) public'
|
2020-10-10 08:15:14 +02:00
|
|
|
stash includes: 'public/**', name: 'public_html'
|
2020-10-10 08:07:55 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('CSS') {
|
|
|
|
agent { dockerfile true }
|
|
|
|
|
|
|
|
steps {
|
|
|
|
sh 'make css'
|
2020-10-10 08:15:14 +02:00
|
|
|
stash includes: 'public/**', name: 'public_css'
|
2020-10-10 08:07:55 +02:00
|
|
|
}
|
|
|
|
}
|
2020-10-10 07:20:16 +02:00
|
|
|
}
|
2020-09-21 10:44:42 +02:00
|
|
|
}
|
|
|
|
|
2020-10-10 07:15:24 +02:00
|
|
|
stage('Deploy') {
|
2020-10-10 08:07:55 +02:00
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
image 'instrumentisto/rsync-ssh'
|
2020-10-10 08:18:50 +02:00
|
|
|
args '-u root --privileged'
|
2020-10-10 08:07:55 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-10 07:20:16 +02:00
|
|
|
steps {
|
|
|
|
unstash 'public_html'
|
2020-10-10 08:07:55 +02:00
|
|
|
unstash 'public_css'
|
2020-09-21 10:44:42 +02:00
|
|
|
|
2020-10-10 10:02:05 +02:00
|
|
|
withCredentials([file(credentialsId: 'ryuslash.org-deploy-key-2', variable: 'KEY_FILE'),
|
|
|
|
file(credentialsId: 'ryuslash-known-hosts', variable: 'KNOWN_HOSTS_FILE')]) {
|
|
|
|
sh 'rsync -e "ssh -p 4511 -o \"UserKnownHostsFile $KNOWN_HOSTS_FILE\" -i $KEY_FILE" -v -c -r --delete public/ "site@ryuslash.org:public_html/"'
|
2020-10-10 07:20:16 +02:00
|
|
|
}
|
2020-09-21 10:44:42 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|