ci: Add Jenkins build+publish pipeline
parent
1822514b36
commit
06ffb6713c
|
@ -0,0 +1,7 @@
|
|||
- .git/
|
||||
- ci/
|
||||
- *.j2
|
||||
- .gitignore
|
||||
- Makefile
|
||||
- publish.sh
|
||||
- render.py
|
5
Makefile
5
Makefile
|
@ -4,12 +4,15 @@ KICKSTARTS = \
|
|||
fedora-rpi.ks \
|
||||
fedora.ks
|
||||
|
||||
.PHONY: all clean
|
||||
.PHONY: all clean publish
|
||||
|
||||
all: $(KICKSTARTS)
|
||||
|
||||
%.ks: %.ks.j2
|
||||
python3 render.py $< > $@
|
||||
|
||||
publish:
|
||||
sh publish.sh
|
||||
|
||||
clean:
|
||||
rm -f $(KICKSTARTS)
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
pipeline {
|
||||
agent {
|
||||
kubernetes {
|
||||
yamlFile 'ci/podTemplate.yaml'
|
||||
yamlMergeStrategy merge()
|
||||
defaultContainer 'build'
|
||||
}
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh 'make'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Publish') {
|
||||
environment {
|
||||
PUBLISH_PATH = "/var/www/html/kickstart/${BRANCH_NAME}/"
|
||||
}
|
||||
steps {
|
||||
sshagent(['jenkins-pxe']) {
|
||||
sh 'make publish'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
spec:
|
||||
containers:
|
||||
- name: build
|
||||
image: git.pyrocufflink.net/containerimages/jenkins-common
|
||||
volumeMounts:
|
||||
- mountPath: /etc/ssh/ssh_known_hosts
|
||||
name: ssh-known-hosts
|
||||
subPath: ssh_known_hosts
|
||||
volumes:
|
||||
- name: ssh-known-hosts
|
||||
configMap:
|
||||
name: ssh-known-hosts
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
: "${PUBLISH_HOST:=$(getent hosts pxe.pyrocufflink.blue | cut -d' ' -f2 | head -n1)}"
|
||||
: "${PUBLISH_PATH:=/var/www/html/kickstart/}"
|
||||
|
||||
ssh "${PUBLISH_HOST}" mkdir -p "${PUBLISH_PATH}"
|
||||
rsync ${PRETEND+-n} -aiFF --delete ./ "${PUBLISH_HOST}:${PUBLISH_PATH}"
|
Loading…
Reference in New Issue