Add CI build/publish pipeline

Dustin 2021-08-23 20:27:46 -05:00
parent b76eaa6427
commit f7311abd04
4 changed files with 43 additions and 0 deletions

6
ci/Containerfile Normal file
View File

@ -0,0 +1,6 @@
FROM alpine
RUN apk update && \
apk add zola --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ &&
apk add rsync &&
rm -rf /var/cache/apk/*

31
ci/Jenkinsfile vendored Normal file
View File

@ -0,0 +1,31 @@
// vim: set ft=groovy sw=4 ts=4 sts=4 et :
pipeline {
agent {
dockerfile {
dir 'ci'
filename 'Containerfile'
}
}
options {
disableConcurrentBuilds()
}
stages {
stage('Build') {
steps {
sh '. ci/build.sh'
}
}
stage('Publish') {
sshagent(['jenkins-web']) {
steps {
sh '. ci/publish.sh'
}
}
}
}
}

1
ci/build.sh Normal file
View File

@ -0,0 +1 @@
zola build

5
ci/publish.sh Normal file
View File

@ -0,0 +1,5 @@
PUBLISH_HOST=web0.pyrocufflink.blue
PUBLISH_USER=webapp.dchblog
PUBLISH_PATH=htdocs/
rsync -aP public/ ${PUBLISH_USER}@${PUBLISH_USER}:${PUBLISH_PATH}