-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathJenkinsfile
More file actions
82 lines (70 loc) · 2.09 KB
/
Jenkinsfile
File metadata and controls
82 lines (70 loc) · 2.09 KB
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
// def staging_url = "https://nearme-example.staging.oregon.platform-os.com"
// def production_url = "https://examples.platform-os.com"
pipeline {
agent any
options {
timeout(time: 20, unit: 'MINUTES')
buildDiscarder(logRotator(daysToKeepStr: '1', artifactDaysToKeepStr: '1'))
}
parameters {
string(description: 'Instance URL', name: 'TARGET_URL', defaultValue: 'https://nearme-example.qa0.oregon.platformos.com')
}
environment {
MPKIT_TOKEN = credentials('MPKIT_TOKEN')
MPKIT_EMAIL = credentials('MPKIT_EMAIL')
MPKIT_URL = "${params.TARGET_URL}"
CI = true
// TC REPORTS
UPLOAD_HOST = "https://tests.qa0.oregon.platformos.com"
REPORT_PATH = "${env.GIT_COMMIT}-${System.currentTimeMillis()}"
REPORT_TYPE = "manual"
}
stages {
stage('build deploy test') {
agent { kubernetes { yaml podTemplate("amd64") } }
steps {
container(name: 'testcafe') {
sh 'npm ci'
sh 'pos-cli deploy'
sh 'sleep 10'
retry(2) {
sh 'npm run test-ci'
}
}
}
post {
failure { archiveArtifacts "screenshots/" }
// always {
// container(name: 'testcafe') {
// sh 'REPORT_TYPE=tc-concurrent npm run ci:test:publish'
// publishHTML (target: [allowMissing: false, alwaysLinkToLastBuild: false, keepAll: true, reportDir: '', reportFiles: 'test-report.html', reportName: "tc-concurrent"])
// }
// }
}
}
}
}
def podTemplate(arch) {
return """
spec:
nodeSelector:
beta.kubernetes.io/arch: "${arch}"
imagePullSecrets:
- name: dockeriosec
- name: ocirsecret
containers:
- name: testcafe
resources:
limits:
cpu: 1
memory: 2Gi
requests:
cpu: 1
memory: 2Gi
image: 'docker.io/platformos/testcafe:4.6.2-1.17.1'
imagePullPolicy: Always
command:
- cat
tty: true
"""
}