From d84df4adee6a756a67c4fd76d6d6d3b777a09457 Mon Sep 17 00:00:00 2001 From: rick <1450685+LinuxSuRen@users.noreply.github.com> Date: Tue, 6 Sep 2022 13:47:26 +0800 Subject: [PATCH] Using Jenkins Pipeline to replace GitHub Actions --- .github/Jenkinsfile | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/Jenkinsfile diff --git a/.github/Jenkinsfile b/.github/Jenkinsfile new file mode 100644 index 000000000..275dca0d8 --- /dev/null +++ b/.github/Jenkinsfile @@ -0,0 +1,34 @@ +pipeline { + agent { + node { + label 'go18' + } + } + + stages { + stage('Test') { + steps { + container('go') { + sh 'go mod tidy' + + sh ''' + if [ -n "$(git status --porcelain)" ]; then + echo 'To fix this check, run "go mod tidy"' + git status # Show the files that failed to pass the check. + exit 1 + fi + ''' + } + } + } + + stage('Build') { + steps { + container('go') { + sh 'CGO_ENABLED=0 go build -tags=\'containers_image_openpgp\' -v -o output/kk ./cmd/main.go' + } + } + } + + } +}