-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
91 lines (81 loc) · 2.29 KB
/
Copy pathJenkinsfile
File metadata and controls
91 lines (81 loc) · 2.29 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
82
83
84
85
86
87
88
89
90
91
// withCredentials([usernamePassword(credentialsId: 'gmail-qa-user', usernameVariable: 'GOOGLE_EMAIL', passwordVariable: 'GOOGLE_PASSWORD')]) {
// sh 'npm run test-ci'
// }
pipeline {
agent none
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(daysToKeepStr: '1', artifactDaysToKeepStr: '1'))
}
parameters {
string(description: 'Instance URL', name: 'TARGET_URL', defaultValue: 'https://platform-e2e.staging.oregon.platform-os.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('deploy') {
options {
timeout(time: 5, unit: 'MINUTES')
}
agent { kubernetes { yaml podTemplate("amd64") } }
steps {
container(name: 'playwright') {
sh 'npm ci'
sh 'pos-cli data clean --include-schema --auto-confirm'
sh 'pos-cli deploy'
sh 'sleep 10'
}
}
}
stage('test') {
options {
timeout(time: 5, unit: 'MINUTES')
}
agent { kubernetes { yaml podTemplate("amd64") } }
steps {
container(name: 'playwright') {
sh 'npm run test-ci'
}
}
post {
always {
container(name: 'playwright') {
publishHTML (target: [allowMissing: true, alwaysLinkToLastBuild: false, keepAll: true, reportDir: 'playwright-report', reportFiles: 'index.html', reportName: "playwright"])
}
}
}
}
}
}
def podTemplate(arch) {
return """
spec:
nodeSelector:
beta.kubernetes.io/arch: "${arch}"
imagePullSecrets:
- name: dockeriosec
- name: ocirsecret
containers:
- name: playwright
resources:
limits:
cpu: 1
memory: 2Gi
requests:
cpu: 1
memory: 2Gi
image: 'docker.io/platformos/playwright:6.0.7-1.60.0'
imagePullPolicy: Always
command:
- cat
tty: true
"""
}