@@ -18,10 +18,8 @@ pipeline {
18
18
BUILD_VERSION = getVersion()
19
19
MAJOR_VERSION = ' 2'
20
20
BRANCH_LOWER = " ${ BRANCH_NAME.toLowerCase().replaceAll('\\\\', '-').replaceAll('/', '-').replaceAll('\\.', '-')} "
21
- COMPOSE_PROJECT_NAME = " npm_${ BRANCH_LOWER} _${ BUILD_NUMBER} "
22
- COMPOSE_FILE = ' docker/docker-compose.ci.yml'
21
+ BUILDX_NAME = " npm_${ BRANCH_LOWER} _${ BUILD_NUMBER} "
23
22
COMPOSE_INTERACTIVE_NO_CLI = 1
24
- BUILDX_NAME = " ${ COMPOSE_PROJECT_NAME} "
25
23
}
26
24
stages {
27
25
stage(' Environment' ) {
@@ -94,75 +92,61 @@ pipeline {
94
92
}
95
93
}
96
94
}
97
- stage(' Cypress' ) {
98
- steps {
99
- // Creating will also create the network prior to
100
- // using it in parallel stages below and mitigating
101
- // a race condition.
102
- sh ' docker-compose build cypress-sqlite'
103
- sh ' docker-compose build cypress-mysql'
104
- sh ' docker-compose create cypress-sqlite'
105
- sh ' docker-compose create cypress-mysql'
106
- }
95
+ }
96
+ }
97
+ stage(' Test Sqlite' ) {
98
+ environment {
99
+ COMPOSE_PROJECT_NAME = " npm_${ BRANCH_LOWER} _${ BUILD_NUMBER} _sqlite"
100
+ COMPOSE_FILE = ' docker/docker-compose.ci.yml:docker/docker-compose.ci.sqlite.yml'
101
+ }
102
+ when {
103
+ not {
104
+ equals expected : ' UNSTABLE' , actual : currentBuild. result
105
+ }
106
+ }
107
+ steps {
108
+ sh ' rm -rf ./test/results/junit/*'
109
+ sh ' ./scripts/ci/fulltest-cypress'
110
+ }
111
+ post {
112
+ always {
113
+ // Dumps to analyze later
114
+ sh ' mkdir -p debug/sqlite'
115
+ sh ' docker logs $(docker-compose ps --all -q fullstack) > debug/sqlite/docker_fullstack.log 2>&1'
116
+ sh ' docker logs $(docker-compose ps --all -q stepca) > debug/sqlite/docker_stepca.log 2>&1'
117
+ sh ' docker logs $(docker-compose ps --all -q pdns) > debug/sqlite/docker_pdns.log 2>&1'
118
+ sh ' docker logs $(docker-compose ps --all -q pdns-db) > debug/sqlite/docker_pdns-db.log 2>&1'
119
+ sh ' docker logs $(docker-compose ps --all -q dnsrouter) > debug/sqlite/docker_dnsrouter.log 2>&1'
120
+ junit ' test/results/junit/*'
121
+ sh ' docker-compose down --remove-orphans --volumes -t 30 || true'
107
122
}
108
123
}
109
124
}
110
- stage(' Integration Tests' ) {
111
- parallel {
112
- stage(' Sqlite' ) {
113
- steps {
114
- // Bring up a stack
115
- sh ' docker-compose up -d fullstack-sqlite'
116
- sh ' ./scripts/wait-healthy $(docker-compose ps --all -q fullstack-sqlite) 120'
117
- // Stop and Start it, as this will test it's ability to restart with existing data
118
- sh ' docker-compose stop fullstack-sqlite'
119
- sh ' docker-compose start fullstack-sqlite'
120
- sh ' ./scripts/wait-healthy $(docker-compose ps --all -q fullstack-sqlite) 120'
121
-
122
- // Run tests
123
- sh ' rm -rf test/results-sqlite'
124
- sh ' docker-compose up cypress-sqlite'
125
- // Get results
126
- sh ' docker cp -L "$(docker-compose ps --all -q cypress-sqlite):/test/results" test/results-sqlite'
127
- }
128
- post {
129
- always {
130
- // Dumps to analyze later
131
- sh ' mkdir -p debug/sqlite'
132
- sh ' docker-compose logs fullstack-sqlite > debug/sqlite/docker_fullstack_sqlite.log'
133
- // Cypress videos and screenshot artifacts
134
- dir(path : ' test/results-sqlite' ) {
135
- archiveArtifacts allowEmptyArchive : true , artifacts : ' **/*' , excludes : ' **/*.xml'
136
- }
137
- junit ' test/results-sqlite/junit/*'
138
- }
139
- }
125
+ stage(' Test Mysql' ) {
126
+ environment {
127
+ COMPOSE_PROJECT_NAME = " npm_${ BRANCH_LOWER} _${ BUILD_NUMBER} _mysql"
128
+ COMPOSE_FILE = ' docker/docker-compose.ci.yml:docker/docker-compose.ci.mysql.yml'
129
+ }
130
+ when {
131
+ not {
132
+ equals expected : ' UNSTABLE' , actual : currentBuild. result
140
133
}
141
- stage(' Mysql' ) {
142
- steps {
143
- // Bring up a stack
144
- sh ' docker-compose up -d fullstack-mysql'
145
- sh ' ./scripts/wait-healthy $(docker-compose ps --all -q fullstack-mysql) 120'
146
-
147
- // Run tests
148
- sh ' rm -rf test/results-mysql'
149
- sh ' docker-compose up cypress-mysql'
150
- // Get results
151
- sh ' docker cp -L "$(docker-compose ps --all -q cypress-mysql):/test/results" test/results-mysql'
152
- }
153
- post {
154
- always {
155
- // Dumps to analyze later
156
- sh ' mkdir -p debug/mysql'
157
- sh ' docker-compose logs fullstack-mysql > debug/mysql/docker_fullstack_mysql.log'
158
- sh ' docker-compose logs db > debug/mysql/docker_db.log'
159
- // Cypress videos and screenshot artifacts
160
- dir(path : ' test/results-mysql' ) {
161
- archiveArtifacts allowEmptyArchive : true , artifacts : ' **/*' , excludes : ' **/*.xml'
162
- }
163
- junit ' test/results-mysql/junit/*'
164
- }
165
- }
134
+ }
135
+ steps {
136
+ sh ' rm -rf ./test/results/junit/*'
137
+ sh ' ./scripts/ci/fulltest-cypress'
138
+ }
139
+ post {
140
+ always {
141
+ // Dumps to analyze later
142
+ sh ' mkdir -p debug/mysql'
143
+ sh ' docker logs $(docker-compose ps --all -q fullstack) > debug/mysql/docker_fullstack.log 2>&1'
144
+ sh ' docker logs $(docker-compose ps --all -q stepca) > debug/mysql/docker_stepca.log 2>&1'
145
+ sh ' docker logs $(docker-compose ps --all -q pdns) > debug/mysql/docker_pdns.log 2>&1'
146
+ sh ' docker logs $(docker-compose ps --all -q pdns-db) > debug/mysql/docker_pdns-db.log 2>&1'
147
+ sh ' docker logs $(docker-compose ps --all -q dnsrouter) > debug/mysql/docker_dnsrouter.log 2>&1'
148
+ junit ' test/results/junit/*'
149
+ sh ' docker-compose down --remove-orphans --volumes -t 30 || true'
166
150
}
167
151
}
168
152
}
0 commit comments