-
Notifications
You must be signed in to change notification settings - Fork 11
/
Jenkinsfile
86 lines (75 loc) · 2.1 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
def name = 'pos-cli'
pipeline {
agent any
environment {
MPKIT_TOKEN = credentials('MPKIT_TOKEN')
MPKIT_EMAIL = "darek+ci@near-me.com"
MPKIT_URL = "https://qa-17263.staging.oregon.platform-os.com"
POS_PORTAL_PASSWORD = credentials('POS_PORTAL_PASSWORD')
}
stages {
stage('Test 16') {
agent { kubernetes { yaml podTemplate("16") } }
options { timeout(time: 300, unit: 'SECONDS') }
steps {
container(name: 'node') {
sh 'set -e'
sh 'chown -R node:node * && chown node:node . && su -c "npm ci && npm test" node'
}
}
}
stage('Test 18') {
agent { kubernetes { yaml podTemplate("18") } }
options { timeout(time: 300, unit: 'SECONDS') }
steps {
container(name: 'node') {
sh 'set -e'
sh 'chown -R node:node * && chown node:node . && su -c "npm ci && npm test" node'
}
}
}
stage('Test 20') {
agent { kubernetes { yaml podTemplate("20") } }
options { timeout(time: 300, unit: 'SECONDS') }
steps {
container(name: 'node') {
sh 'set -e'
sh 'chown -R node:node * && chown node:node . && su -c "npm ci && npm test" node'
}
}
}
stage('Test tagged release') {
agent { kubernetes { yaml podTemplate("20.11") } }
// when { tag pattern: "v.*", comparator: "REGEXP"}
steps {
container(name: 'node') {
sh 'npm install -g @platformos/pos-cli'
// sh 'pos-cli init'
// sh 'pos-cli data clean --auto-confirm --include-schema'
// sh 'pos-cli deploy'
}
}
}
}
}
def podTemplate(version) {
return """
spec:
nodeSelector:
beta.kubernetes.io/arch: amd64
containers:
- name: node
resources:
limits:
cpu: 2
memory: 2Gi
requests:
cpu: 2
memory: 2Gi
image: 'node:${version}-alpine'
imagePullPolicy: IfNotPresent
command:
- cat
tty: true
"""
}