forked from helxplatform/tycho
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
59 lines (57 loc) · 1.38 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
library 'pipeline-utils@master'
CCV = ""
pipeline {
agent {
kubernetes {
label 'kaniko-build-agent'
yaml """
kind: Pod
metadata:
name: kaniko
spec:
containers:
- name: jnlp
workingDir: /home/jenkins/agent
- name: go
workingDir: /home/jenkins/go
image: golang:1.19.1
imagePullPolicy: Always
resources:
requests:
cpu: "512m"
memory: "512Mi"
ephemeral-storage: "1Gi"
limits:
cpu: "512m"
memory: "1024Mi"
ephemeral-storage: "1Gi"
command:
- /bin/bash
tty: true
"""
}
}
environment {
PATH = "/busybox:/kaniko:/ko-app/:$PATH"
DOCKERHUB_CREDS = credentials("${env.CONTAINERS_REGISTRY_CREDS_ID_STR}")
GITHUB_CREDS = credentials("${env.GITHUB_CREDS_ID_STR}")
REGISTRY = "${env.REGISTRY}"
REG_OWNER="helxplatform"
REPO_NAME="tycho"
COMMIT_HASH="${sh(script:"git rev-parse --short HEAD", returnStdout: true).trim()}"
IMAGE_NAME="${REGISTRY}/${REG_OWNER}/${REPO_NAME}"
}
stages {
stage('Build') {
steps {
script {
container(name: 'go', shell: '/bin/bash') {
if (BRANCH_NAME.equals("master")) {
CCV = go.ccv()
}
}
}
}
}
}
}