From 76b2c0dd48c99f31caac1e324af82e1f4cbe90f7 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Mon, 12 Dec 2022 13:38:58 -0600 Subject: [PATCH] ci: build in kubernetes We can use the same pod definition for both the x86_64 and aarch64 stages, since the `kubernetes` agent block can override the node selector. --- ci/Dockerfile | 13 ------------- ci/Jenkinsfile | 14 ++++++++------ ci/podTemplate.yaml | 8 ++++++++ 3 files changed, 16 insertions(+), 19 deletions(-) delete mode 100644 ci/Dockerfile create mode 100644 ci/podTemplate.yaml diff --git a/ci/Dockerfile b/ci/Dockerfile deleted file mode 100644 index 5ef8faa..0000000 --- a/ci/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM rust:1.59.0-slim - -RUN apt-get update && \ - apt-get install -y \ - cmake \ - git \ - libssl-dev \ - libx11-dev \ - libxext-dev \ - pkg-config \ - && \ - apt-get clean && \ - rm -rf /var/cache/apt /var/lib/apt diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 3310508..4e81fa2 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -10,9 +10,10 @@ pipeline { parallel { stage('Build: x86_64') { agent { - dockerfile { - label 'x86_64' - dir 'ci' + kubernetes { + yamlFile 'ci/podTemplate.yaml' + nodeSelector 'kubernetes.io/arch=amd64' + defaultContainer 'build' } } steps { @@ -27,9 +28,10 @@ pipeline { stage('Build: aarch64') { agent { - dockerfile { - label 'aarch64' - dir 'ci' + kubernetes { + yamlFile 'ci/podTemplate.yaml' + nodeSelector 'kubernetes.io/arch=arm64' + defaultContainer 'build' } } steps { diff --git a/ci/podTemplate.yaml b/ci/podTemplate.yaml new file mode 100644 index 0000000..e4c1560 --- /dev/null +++ b/ci/podTemplate.yaml @@ -0,0 +1,8 @@ +spec: + containers: + - name: build + image: git.pyrocufflink.net/containerimages/build/mqttdpms + command: + - cat + stdin: true + tty: true