ci: Begin Jenkins build pipeline
dustin/dynk8s-provisioner/pipeline/head There was a failure building this commit
Details
dustin/dynk8s-provisioner/pipeline/head There was a failure building this commit
Details
parent
ac1b20d910
commit
c43a46cf7b
|
@ -0,0 +1,4 @@
|
|||
target/
|
||||
!target/*/dynk8s-provisioner
|
||||
src/
|
||||
test/
|
|
@ -8,3 +8,8 @@ trim_trailing_whitespace = true
|
|||
|
||||
[**.rs]
|
||||
max_line_length = 79
|
||||
|
||||
[Jenkinsfile]
|
||||
max_line_length = 79
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
FROM fedora:36
|
||||
|
||||
COPY target/release/dynk8s-provisioner /usr/bin/
|
||||
|
||||
CMD ["/usr/bin/dynk8s-provisioner"]
|
|
@ -0,0 +1,59 @@
|
|||
pipeline {
|
||||
agent {
|
||||
kubernetes {
|
||||
yamlFile 'ci/podTemplate.yaml'
|
||||
workspaceVolume dynamicPVC()
|
||||
}
|
||||
}
|
||||
|
||||
options {
|
||||
buildDiscarder logRotator(numToKeepStr: '5')
|
||||
disableConcurrentBuilds()
|
||||
}
|
||||
|
||||
environment {
|
||||
CARGO_HOME = "${env.WORKSPACE}/.cargo"
|
||||
TMPDIR = "${env.WORKSPACE_TMP}"
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Test') {
|
||||
steps {
|
||||
container('build') {
|
||||
sh '. ci/test.sh'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build') {
|
||||
steps {
|
||||
container('build') {
|
||||
sh '. ci/build.sh'
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
dir('target/release') {
|
||||
archiveArtifacts 'dynk8s-provisioner'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Container') {
|
||||
steps {
|
||||
container('podman') {
|
||||
sh '. ci/container.sh'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Publish') {
|
||||
steps {
|
||||
container('podman') {
|
||||
sh '. ci/publish.sh'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash -ex
|
||||
|
||||
cargo build --release
|
|
@ -0,0 +1,5 @@
|
|||
# shellcheck: shell=sh
|
||||
|
||||
tag_name() {
|
||||
echo "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g' -e 's/^[.-]/_/'
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash -ex
|
||||
|
||||
. ci/common.sh
|
||||
|
||||
podman build -t dynk8s-provider:$(tag_name ${BUILD_TAG}) .
|
|
@ -0,0 +1,19 @@
|
|||
spec:
|
||||
securityContext:
|
||||
fsGroup: 1000
|
||||
containers:
|
||||
- name: build
|
||||
image: docker.io/rust:1.63-slim
|
||||
command:
|
||||
- sleep
|
||||
- infinity
|
||||
securityContext:
|
||||
readOnlyRootFilesystem: true
|
||||
runAsUser: 1000
|
||||
- name: podman
|
||||
image: quay.io/containers/podman:v3.4
|
||||
command:
|
||||
- sleep
|
||||
- infinity
|
||||
securityContext:
|
||||
privileged: true
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash -ex
|
||||
|
||||
. ci/common.sh
|
||||
|
||||
remote=gitea.pyrocufflink.blue/dustin/dynk8s-provisioner
|
||||
t=$(tag_name ${BUILD_TAG})
|
||||
podman push -t dynk8s-provider:${t} ${remote}:${t}
|
||||
if [ "${BRANCH_NAME}" = master ]; then
|
||||
podman push -t dynk8s-provider:${t} ${remote}:${t}
|
||||
fi
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash -ex
|
||||
|
||||
cargo test
|
Loading…
Reference in New Issue