wip: ci: Build in Kubernetes
dustin/dustin.web/pipeline/pr-master Something is wrong with the build of this commit Details

Dustin 2022-12-02 21:36:03 -06:00
parent 77ace212f2
commit 6af42d22a8
4 changed files with 36 additions and 27 deletions

View File

@ -1,15 +0,0 @@
FROM alpine
RUN echo jenkins:*:3000018:3000017::/var/lib/jenkins:/bin/bash >> /etc/passwd
RUN apk update && \
apk add zola --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ && \
apk add \
openssh-client-default \
python3 \
py3-ruamel.yaml \
rsync \
&& \
rm -rf /var/cache/apk/*
COPY ssh_known_hosts /etc/ssh/ssh_known_hosts

22
ci/Jenkinsfile vendored
View File

@ -2,9 +2,8 @@
pipeline {
agent {
dockerfile {
dir 'ci'
filename 'Containerfile'
kubernetes {
yamlFile 'ci/podTemplate.yaml'
}
}
@ -12,22 +11,25 @@ pipeline {
disableConcurrentBuilds()
}
triggers {
pollSCM ''
}
stages {
stage('Build') {
steps {
sh '. ci/build.sh'
container('zola') {
sh 'zola build --base-url /'
}
container('python') {
sh '. ci/build.sh'
}
}
}
stage('Publish') {
steps {
sshagent(['jenkins-web']) {
sh '. ci/publish.sh'
container('rsync') {
sshagent(['jenkins-web']) {
sh '. ci/publish.sh'
}
}
}
}

View File

@ -1,5 +1,3 @@
zola build --base-url /
python3 /dev/fd/3 < songquotes.yml > public/songquotes.json 3<<EOF
from ruamel.yaml import safe_load as load
from json import dump

24
ci/podTemplate.yaml Normal file
View File

@ -0,0 +1,24 @@
spec:
securityContext:
runAsUser: 1000
containers:
- name: zola
image: ghcr.io/getzola/zola:v0.16.0
command:
- openssl
stdin: true
tty: true
- name: python
image: docker.io/python:3.10
command:
- python
args:
- c
- import signal; signal.pause()
- name: rsync
image: git.pyrocufflink.net/containerimages/rsync
command:
- python3
args:
- c
- import signal; signal.pause()