draft: ci: Build container image

This image will be used to deploy the application on the Kubernetes
cluster.
This commit is contained in:
2022-08-01 18:29:08 -05:00
parent 7b00ab1f2c
commit 536c859bca
8 changed files with 102 additions and 0 deletions

16
ci/Jenkinsfile vendored
View File

@@ -51,5 +51,21 @@ pipeline {
}
}
}
stage('Build Container') {
steps {
container('podman') {
sh '. ci/build-container.sh'
}
}
}
stage('Publish Container') {
steps {
container('podman') {
sh '. ci/publish-container.sh'
}
}
}
}
}

5
ci/build-container.sh Normal file
View File

@@ -0,0 +1,5 @@
#!/bin/sh -ex
cp -r ui/dist container/ui
cp -r svc/dist container/wheels
podman build -t hudctrl:${BUILD_NUMBER} container

View File

@@ -27,3 +27,10 @@ spec:
securityContext:
readOnlyRootFilesystem: true
runAsUser: 1000
- name: podman
image: quay.io/containers/podman:v3.4
command:
- sleep
- infinity
securityContext:
privileged: true

3
ci/publish-container.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/sh -ex
podman push hudctrl:${BUILD_ID} registry.pyrocufflink.blue/hudctrl:${BUILD_ID}