build-binary
This commit is contained in:
parent
d2e41d6367
commit
b42a4df38c
74
Jenkinsfile
vendored
Normal file
74
Jenkinsfile
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
// cmake '-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mingw.cmake' .
|
||||
|
||||
def label = "jenkins-${UUID.randomUUID().toString()}"
|
||||
|
||||
def repository = "registry.c.test-chamber-13.lan"
|
||||
|
||||
podTemplate(
|
||||
label: label,
|
||||
name: "pipeline-worker",
|
||||
yaml: """---
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: pipeline-worker
|
||||
spec:
|
||||
containers:
|
||||
- name: compile
|
||||
imagePullPolicy: Always
|
||||
image: ${repository}/dockerhub/library/golang:alpine
|
||||
tty: true
|
||||
command:
|
||||
- /bin/cat
|
||||
""") {
|
||||
node (label) {
|
||||
def workspace = pwd()
|
||||
|
||||
container("compile") {
|
||||
stage ("Pull Local Repo") {
|
||||
checkout([
|
||||
$class: "GitSCM",
|
||||
branches: [
|
||||
[
|
||||
name: "refs/remotes/origin/main",
|
||||
],
|
||||
],
|
||||
userRemoteConfigs: [
|
||||
[
|
||||
url: "ssh://git@gitea.smoothnet.org:31822/nhyatt/go-temper.git",
|
||||
credentialsId: "Gitea-Read-Only-Token",
|
||||
],
|
||||
],
|
||||
extensions: [
|
||||
[
|
||||
$class: "CloneOption",
|
||||
shallow: true,
|
||||
],
|
||||
[
|
||||
$class: "CheckoutOption",
|
||||
timeout: 2,
|
||||
],
|
||||
],
|
||||
])
|
||||
}
|
||||
|
||||
stage("Build go-temper") {
|
||||
container("compile") {
|
||||
sh """
|
||||
apk add --no-cache libusb-dev gcc g++ upx
|
||||
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o go-temper ./cmd/go-temper
|
||||
upx --brute go-temper
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Store Artifacts") {
|
||||
archiveArtifacts (artifacts: "go-temper",
|
||||
fingerprint: true,
|
||||
allowEmptyArchive: false,
|
||||
onlyIfSuccessful: true,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user