add CI
This commit is contained in:
parent
d846b81840
commit
8577e38b8b
18
automation/Dockerfile
Normal file
18
automation/Dockerfile
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# npm base container, we need to install some npm dependencies as part of the website build.
|
||||||
|
FROM node:latest
|
||||||
|
|
||||||
|
RUN apt-get update
|
||||||
|
RUN apt-get --yes upgrade
|
||||||
|
# Required in case tzdata is a installed, won't install otherwise
|
||||||
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
RUN apt-get --yes install rsync openssh-client
|
||||||
|
|
||||||
|
# Install hugo v0.121.1
|
||||||
|
RUN curl -sSL https://github.com/gohugoio/hugo/releases/download/v0.121.1/hugo_0.121.1_darwin-universal.tar.gz | tar -xz --directory /usr/local/bin
|
||||||
|
|
||||||
|
#ssh needs a valid user to work
|
||||||
|
RUN adduser --uid 114 jenkins
|
||||||
|
|
||||||
|
# add documentation server to known hosts
|
||||||
|
RUN echo "|1|/LzCV4BuTmTb2wKnD146l9fTKgQ=|NJJtVjvWbtRt8OYqFgcYRnMQyVw= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNL8ssTonYtgiR/6RRlSIK9WU1ywOcJmxFTLcEblAwH7oifZzmYq3XRfwXrgfMpylEfMFYfCU8JRqtmi19xc21A=" >> /etc/ssh/ssh_known_hosts
|
||||||
|
RUN echo "|1|CcBvBc3EG03G+XM5rqRHs6gK/Gg=|oGeJQ+1I8NGI2THIkJsW92DpTzs= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNL8ssTonYtgiR/6RRlSIK9WU1ywOcJmxFTLcEblAwH7oifZzmYq3XRfwXrgfMpylEfMFYfCU8JRqtmi19xc21A=" >> /etc/ssh/ssh_known_hosts
|
26
automation/Jenkinsfile
vendored
Normal file
26
automation/Jenkinsfile
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
pipeline {
|
||||||
|
agent {
|
||||||
|
dockerfile {
|
||||||
|
dir 'automation'
|
||||||
|
reuseNode true
|
||||||
|
args '--network host'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// agent any
|
||||||
|
stages {
|
||||||
|
stage('Deployment') {
|
||||||
|
when {
|
||||||
|
branch 'main'
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
sh 'npm install'
|
||||||
|
sh 'hugo'
|
||||||
|
sshagent(credentials: ['documentation-buildfix']) {
|
||||||
|
// Deploy to Apache webserver
|
||||||
|
sh "rsync -r --delete --exclude 'content/projects/' --exclude static/fonts/univers public/ buildfix@documentation.irs.uni-stuttgart.de:/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user