ci: Begin Jenkins build pipeline
parent
3c5ee6fa00
commit
3bca14132e
|
@ -0,0 +1 @@
|
||||||
|
ui/*.tar.gz
|
|
@ -0,0 +1,55 @@
|
||||||
|
// vim: set sw=4 ts=4 sts=4 et :
|
||||||
|
// vim: set ft=groovy :
|
||||||
|
|
||||||
|
pipeline {
|
||||||
|
agent {
|
||||||
|
kubernetes {
|
||||||
|
yamlFile 'ci/podTemplate.yaml'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage('Build') {
|
||||||
|
parallel {
|
||||||
|
stage('Build Backend') {
|
||||||
|
steps {
|
||||||
|
container('python') {
|
||||||
|
dir('svc') {
|
||||||
|
sh '. ../ci/build-svc.sh'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
post {
|
||||||
|
success {
|
||||||
|
dir('svc/dist') {
|
||||||
|
archiveArtifacts 'hudctrl-*'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build Frontend') {
|
||||||
|
steps {
|
||||||
|
container('node') {
|
||||||
|
dir('ui') {
|
||||||
|
sh '. ../ci/build-ui.sh'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
post {
|
||||||
|
success {
|
||||||
|
dir('ui') {
|
||||||
|
archiveArtifacts 'hudctrl-ui.tar.gz'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
failure {
|
||||||
|
dir('ui/npm_cache/_logs') {
|
||||||
|
archiveArtifacts '*'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh -ex
|
||||||
|
|
||||||
|
python -m venv .venv
|
||||||
|
.venv/bin/python -m pip install --no-cache-dir -U pip setuptools wheel
|
||||||
|
.venv/bin/python -m pip install --no-cache-dir poetry
|
||||||
|
|
||||||
|
.venv/bin/poetry build
|
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/sh -ex
|
||||||
|
|
||||||
|
export TEMP="${PWD}/tmp"
|
||||||
|
mkdir "${TEMP}"
|
||||||
|
|
||||||
|
# https://github.com/npm/cli/issues/3208#issuecomment-1002990902
|
||||||
|
# Work around crazy performance issue in npm@7 / npm@8
|
||||||
|
mkdir node_modules
|
||||||
|
|
||||||
|
npm ci
|
||||||
|
|
||||||
|
npm run build
|
||||||
|
find dist -mindepth 1 -maxdepth 1 -printf '%P\0' \
|
||||||
|
| xargs -0 tar -czf hudctrl-ui.tar.gz -C dist
|
|
@ -0,0 +1,27 @@
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: python
|
||||||
|
image: docker.io/python:3.10
|
||||||
|
command:
|
||||||
|
- sleep
|
||||||
|
- infinity
|
||||||
|
securityContext:
|
||||||
|
readOnlyRootFilesystem: true
|
||||||
|
runAsUser: 1000
|
||||||
|
- name: node
|
||||||
|
image: docker.io/node:16-bullseye-slim
|
||||||
|
command:
|
||||||
|
- sleep
|
||||||
|
- infinity
|
||||||
|
env:
|
||||||
|
- name: npm_config_cache
|
||||||
|
value: ./npm_cache
|
||||||
|
- name: NODE_OPTIONS
|
||||||
|
value: '--max_old_space_size=512'
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 1G
|
||||||
|
cpu: 1.0
|
||||||
|
securityContext:
|
||||||
|
readOnlyRootFilesystem: true
|
||||||
|
runAsUser: 1000
|
Loading…
Reference in New Issue