Skip to content

Commit f7c87f6

Browse files
committed
Updated CI to run some things in parallel
1 parent e4ef095 commit f7c87f6

File tree

1 file changed

+51
-54
lines changed

1 file changed

+51
-54
lines changed

Diff for: Jenkinsfile

+51-54
Original file line numberDiff line numberDiff line change
@@ -60,27 +60,43 @@ pipeline {
6060
}
6161
}
6262
}
63-
stage('Build and Test') {
64-
steps {
65-
script {
66-
// Frontend and Backend
67-
def shStatusCode = sh(label: 'Checking and Building', returnStatus: true, script: '''
68-
set -e
69-
./scripts/ci/frontend-build > ${WORKSPACE}/tmp-sh-build 2>&1
70-
./scripts/ci/test-and-build > ${WORKSPACE}/tmp-sh-build 2>&1
71-
''')
72-
shOutput = readFile "${env.WORKSPACE}/tmp-sh-build"
73-
if (shStatusCode != 0) {
74-
error "${shOutput}"
63+
stage('Builds') {
64+
parallel {
65+
stage('Project') {
66+
steps {
67+
script {
68+
// Frontend and Backend
69+
def shStatusCode = sh(label: 'Checking and Building', returnStatus: true, script: '''
70+
set -e
71+
./scripts/ci/frontend-build > ${WORKSPACE}/tmp-sh-build 2>&1
72+
./scripts/ci/test-and-build > ${WORKSPACE}/tmp-sh-build 2>&1
73+
''')
74+
shOutput = readFile "${env.WORKSPACE}/tmp-sh-build"
75+
if (shStatusCode != 0) {
76+
error "${shOutput}"
77+
}
78+
}
79+
}
80+
post {
81+
always {
82+
sh 'rm -f ${WORKSPACE}/tmp-sh-build'
83+
}
84+
failure {
85+
npmGithubPrComment("CI Error:\n\n```\n${shOutput}\n```", true)
86+
}
7587
}
7688
}
77-
}
78-
post {
79-
always {
80-
sh 'rm -f ${WORKSPACE}/tmp-sh-build'
81-
}
82-
failure {
83-
npmGithubPrComment("CI Error:\n\n```\n${shOutput}\n```", true)
89+
stage('Docs') {
90+
steps {
91+
dir(path: 'docs') {
92+
sh 'yarn install'
93+
sh 'yarn build'
94+
}
95+
dir(path: 'docs/.vuepress/dist') {
96+
sh 'tar -czf ../../docs.tgz *'
97+
}
98+
archiveArtifacts(artifacts: 'docs/docs.tgz', allowEmptyArchive: false)
99+
}
84100
}
85101
}
86102
}
@@ -140,25 +156,6 @@ pipeline {
140156
}
141157
}
142158
}
143-
stage('Docs') {
144-
when {
145-
not {
146-
equals expected: 'UNSTABLE', actual: currentBuild.result
147-
}
148-
}
149-
steps {
150-
dir(path: 'docs') {
151-
sh 'yarn install'
152-
sh 'yarn build'
153-
}
154-
155-
dir(path: 'docs/.vuepress/dist') {
156-
sh 'tar -czf ../../docs.tgz *'
157-
}
158-
159-
archiveArtifacts(artifacts: 'docs/docs.tgz', allowEmptyArchive: false)
160-
}
161-
}
162159
stage('MultiArch Build') {
163160
when {
164161
not {
@@ -172,9 +169,9 @@ pipeline {
172169
}
173170
}
174171
}
175-
stage('Docs Deploy') {
172+
stage('Docs / Comment') {
176173
parallel {
177-
stage('Master') {
174+
stage('Master Docs') {
178175
when {
179176
allOf {
180177
branch 'master'
@@ -187,7 +184,7 @@ pipeline {
187184
npmDocsReleaseMaster()
188185
}
189186
}
190-
stage('Develop') {
187+
stage('Develop Docs') {
191188
when {
192189
allOf {
193190
branch 'develop'
@@ -200,20 +197,20 @@ pipeline {
200197
npmDocsReleaseDevelop()
201198
}
202199
}
203-
}
204-
}
205-
stage('PR Comment') {
206-
when {
207-
allOf {
208-
changeRequest()
209-
not {
210-
equals expected: 'UNSTABLE', actual: currentBuild.result
200+
stage('PR Comment') {
201+
when {
202+
allOf {
203+
changeRequest()
204+
not {
205+
equals expected: 'UNSTABLE', actual: currentBuild.result
206+
}
207+
}
208+
}
209+
steps {
210+
script {
211+
npmGithubPrComment("Docker Image for build ${BUILD_NUMBER} is available on [DockerHub](https://cloud.docker.com/repository/docker/jc21/${IMAGE}) as `jc21/${IMAGE}:github-${BRANCH_LOWER}`\n\n**Note:** ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes.", true)
212+
}
211213
}
212-
}
213-
}
214-
steps {
215-
script {
216-
npmGithubPrComment("Docker Image for build ${BUILD_NUMBER} is available on [DockerHub](https://cloud.docker.com/repository/docker/jc21/${IMAGE}) as `jc21/${IMAGE}:github-${BRANCH_LOWER}`\n\n**Note:** ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes.", true)
217214
}
218215
}
219216
}

0 commit comments

Comments
 (0)