Merge pull request #1493 from LinuxSuRen/pr-jenkinsfile

Using Jenkins Pipeline to replace GitHub Actions
This commit is contained in:
KubeSphere CI Bot 2022-09-08 11:06:41 +08:00 committed by GitHub
commit fa6b64b897
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

34
.github/Jenkinsfile vendored Normal file
View File

@ -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'
}
}
}
}
}