From 932aa46a181daae264c7ff681b52c6d6b286f0bf Mon Sep 17 00:00:00 2001 From: William Petit Date: Mon, 5 Sep 2022 10:56:41 +0200 Subject: [PATCH] Add Jenkinsfile --- Jenkinsfile | 33 +++++++++++++++++++++++++++++++++ Makefile | 2 +- misc/ci/Dockerfile | 5 +++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 Jenkinsfile create mode 100644 misc/ci/Dockerfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..6e3cb8e --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,33 @@ +@Library('cadoles@gitea-release') _ + +pipeline { + agent { + dockerfile { + filename 'Dockerfile' + dir 'misc/ci' + } + } + + stages { + stage('Release') { + steps { + script { + sh 'ARCH_TARGETS="amd64 arm arm64" make release' + + def attachments = sh(returnStdout: true, script: 'find release -maxdepth 1 -type f').split(' ') + gitea.release('forge-jenkins', 'Cadoles', 'go-http-peering', [ + 'attachments': attachments + ]) + } + } + } + } + + post { + always { + script { + cleanWs() + } + } + } +} diff --git a/Makefile b/Makefile index 12debeb..ec53ef2 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,6 @@ doc: godoc -http=:6060 bin/keygen: - go build -o bin/keygen ./cmd/keygen + CGO_ENABLED=0 go build -o bin/keygen ./cmd/keygen .PHONY: test lint doc sequence-diagram bin/keygen release \ No newline at end of file diff --git a/misc/ci/Dockerfile b/misc/ci/Dockerfile new file mode 100644 index 0000000..4002b0a --- /dev/null +++ b/misc/ci/Dockerfile @@ -0,0 +1,5 @@ +FROM golang:1.19 + +RUN apt-get update && apt-get install -y make upx-ucl curl ca-certificates bash jq + +RUN curl -k https://forge.cadoles.com/Cadoles/Jenkins/raw/branch/master/resources/com/cadoles/common/add-letsencrypt-ca.sh | bash