-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathJenkinsfile
61 lines (56 loc) · 1.65 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
60
61
pipeline {
agent {
kubernetes {
//自定义执行环境
label 'cli-test'
yaml """
apiVersion: v1
kind: Pod
spec:
containers:
- name: test
image: mx2542/cli-test:1.1
command: ['cat']
tty: true
"""
}
}
parameters {
string(name:'GITHUB_ACCOUNT',defaultValue: 'lunz1207',description:'默认的 chart 仓库')
string(name:'NAME_SPACES',defaultValue: 'testing',description:'平台的命名空间')
string(name:'TKEEL_VERSION',defaultValue: '0.4.2-testing',description:'平台版本')
}
environment {
KUBECONFIG_CREDENTIAL_ID = 'kubeconfig'
}
stages {
stage ('checkout scm') {
steps {
checkout(scm)
}
}
stage ('build tkeel') {
steps {
container ('test') {
sh 'make build'
sh './dist/linux_amd64/release/tkeel -h'
}
}
}
stage('init tkeel') {
steps {
container ('test') {
withCredentials([
kubeconfigFile(
credentialsId: env.KUBECONFIG_CREDENTIAL_ID,
variable: 'KUBECONFIG')
]) {
sh './dist/linux_amd64/release/tkeel doctor'
sh './dist/linux_amd64/release/tkeel init --repo-url https://$GITHUB_ACCOUNT.github.io/helm-charts/ --repo-name $GITHUB_ACCOUNT --runtime-version $TKEEL_VERSION --wait --timeout 3000'
// sh './dist/linux_amd64/release/tkeel init --wait --timeout 3000'
}
}
}
}
}
}