From f8bb088574ade3c51a0e720143be3437534a5363 Mon Sep 17 00:00:00 2001 From: Christian Schmied Date: Thu, 26 Sep 2024 11:39:22 +0200 Subject: [PATCH] added Jenkinsfile Test --- Jenkinsfile | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..f4494af --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,56 @@ +pipeline { + environment { + ORG = "go" + APP = "archiver" + GIT_REPO_OWNER = "go" + GIT_REPO_NAME = "archiver" + } + + agent { + docker { + image 'docker.sportwanninger.de/infrastructure/golang-mingw:1.23.1' + args "${dindArgs()}" + } + } + + options { + buildDiscarder(logRotator(numToKeepStr: '5', artifactNumToKeepStr: '5')) + disableConcurrentBuilds() + } + + stages { + stage('Build') { + environment { + CGO_ENABLED = "1" + GOOS = "linux" + CXX = "g++" + CC = "gcc" + } + steps { + ansiColor('xterm') { + sh "go test ./..." + } + } + } + stage('Build Win') { + environment { + CGO_ENABLED = "1" + GOOS = "windows" + CXX = "x86_64-w64-mingw32-g++" + CC = "x86_64-w64-mingw32-gcc" + } + steps { + ansiColor('xterm') { + sh "go test -exec wine64 -ldflags \"-extldflags '-static -fstack-protector'\" ./..." + } + } + } + } + post { + always { + script { + sendBuildMessage(); + } + } + } +}