creating image with c wrappers
go-rpi-ws2811-lib/pipeline/head This commit looks good
Details
go-rpi-ws2811-lib/pipeline/head This commit looks good
Details
commit
ebb88b1e3a
@ -0,0 +1,29 @@
|
|||||||
|
FROM debian AS lib_builder
|
||||||
|
|
||||||
|
WORKDIR /foundry
|
||||||
|
|
||||||
|
RUN apt-get update -y && apt-get install -y \
|
||||||
|
build-essential \
|
||||||
|
cmake \
|
||||||
|
git
|
||||||
|
|
||||||
|
RUN git clone https://github.com/jgarff/rpi_ws281x.git \
|
||||||
|
&& cd rpi_ws281x \
|
||||||
|
&& mkdir build \
|
||||||
|
&& cd build \
|
||||||
|
&& cmake -D BUILD_SHARED=OFF -D BUILD_TEST=OFF .. \
|
||||||
|
&& cmake --build . \
|
||||||
|
&& make install
|
||||||
|
|
||||||
|
# Stage 1 : Build a go image with the rpi_ws281x C library and the go wrapper
|
||||||
|
|
||||||
|
FROM golang:latest
|
||||||
|
COPY --from=lib_builder /usr/local/lib/libws2811.a /usr/local/lib/
|
||||||
|
COPY --from=lib_builder /usr/local/include/ws2811 /usr/local/include/ws2811
|
||||||
|
|
||||||
|
WORKDIR /go/src/github.com/rpi-ws281x/rpi-ws281x-go
|
||||||
|
COPY . .
|
||||||
|
RUN GO111MODULE=off go get -d -v ./...
|
||||||
|
RUN GO111MODULE=off go build -v ./...
|
||||||
|
|
||||||
|
WORKDIR /go
|
@ -0,0 +1,25 @@
|
|||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
stages {
|
||||||
|
/*stage('GitCheckOut') {
|
||||||
|
steps{
|
||||||
|
checkout([$class: 'GitSCM', branches: [[name: "${env.CHECKOUT}"]], extensions: [], userRemoteConfigs: [[credentialsId: 'gitea', url: "$GIT_URL"]]])
|
||||||
|
}
|
||||||
|
|
||||||
|
}*/
|
||||||
|
stage('buildPush') {
|
||||||
|
steps{
|
||||||
|
sh 'docker buildx rm jenkins-agent || echo "none there"'
|
||||||
|
sh '''#!/bin/bash
|
||||||
|
docker buildx create --bootstrap --name=jenkins-agent --driver=kubernetes --driver-opt=namespace=jenkinsagent --driver-opt=qemu.install=true --driver-opt=\\"nodeselector=kubernetes.io/arch=amd64\\" --driver-opt=\\"image=registry.local/buildkit-wagnerca:stable-3-rootless\\" --use
|
||||||
|
'''
|
||||||
|
sh 'docker buildx build . -t registry.local/ws2811arm64lib:v0.0.$BUILD_NUMBER --push --platform=linux/arm64,linux/amd64'
|
||||||
|
sh 'docker buildx build . -t registry.local/ws2811arm64lib:latest --push --platform=linux/arm64,linux/amd64'
|
||||||
|
sh 'docker buildx rm jenkins-agent'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue