-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile
More file actions
94 lines (92 loc) · 2.77 KB
/
Copy pathJenkinsfile
File metadata and controls
94 lines (92 loc) · 2.77 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
92
93
94
pipeline {
agent any
stages {
stage('Notify Build Start') {
steps {
slackSend channel: "#engineering", message: "Build Started: ${currentBuild.fullDisplayName} (<${env.RUN_DISPLAY_URL}|BlueOcean> <${env.BUILD_URL}|Open>)"
}
}
stage('Checkout') {
steps {
checkout scm
}
}
stage('Prepare') {
steps {
sh 'make clean-stack && make prepare-stack'
sh 'cp packages/lightwallet/common/environments/environment.example.ts packages/lightwallet/common/environments/environment.ts'
sh 'cp packages/lightwallet/common/environments/environment.example.ts packages/lightwallet/common/environments/environment.dev.ts'
}
}
stage('Unit Tests') {
steps {
sh 'cd packages/lightwallet && npm test'
}
}
stage('E2E Tests') {
steps {
withCredentials([
string(credentialsId: 'browserstack-user', variable: 'browserstackUser'),
string(credentialsId: 'browserstack-key', variable: 'browserstackKey')
]) {
sh 'cd packages/lightwallet/desktop && npm start &'
sh 'wget --retry-connrefused --no-check-certificate -T 30 http://localhost:8888'
sh "cd packages/lightwallet && BROWSERSTACK_USER=${browserstackUser} BROWSERSTACK_KEY=${browserstackKey} npm run test:e2e"
}
}
}
stage('Build Wallets [Dev]') {
parallel {
stage('Build MLW') {
steps {
sh 'cd packages/lightwallet && npm run build'
}
}
stage('Build DLW') {
steps {
sh 'cd packages/lightwallet/desktop && npm run build'
}
}
}
}
stage('Build Wallets [Production]') {
parallel {
stage('Build MLW') {
steps {
sh 'cd packages/lightwallet && npm run build -- --prod'
}
}
stage('Build DLW') {
steps {
sh 'cd packages/lightwallet/desktop && npm run build:prod'
}
}
}
}
stage('Test Wallets') {
parallel {
stage('Test MLW') {
steps {
sh 'cd packages/lightwallet && npm run test'
}
}
stage('Test DLW') {
steps {
sh 'cd packages/lightwallet/desktop && npm run test'
}
}
}
}
}
post {
always {
sh 'make clean-stack'
}
success {
slackSend color: "good", channel: "#engineering", message: "Build finished successfully: ${currentBuild.fullDisplayName} (<${env.RUN_DISPLAY_URL}|BlueOcean> <${env.BUILD_URL}|Open>)"
}
failure {
slackSend color: "danger", channel: "#engineering", message: "Build failed: ${currentBuild.fullDisplayName} (<${env.RUN_DISPLAY_URL}|BlueOcean> <${env.BUILD_URL}|Open>)"
}
}
}