mirror of
https://github.com/jc21/nginx-proxy-manager.git
synced 2024-08-30 18:22:48 +00:00
Updated CI to run some things in parallel
This commit is contained in:
parent
e4ef095254
commit
f7c87f63bd
105
Jenkinsfile
vendored
105
Jenkinsfile
vendored
@ -60,27 +60,43 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Build and Test') {
|
stage('Builds') {
|
||||||
steps {
|
parallel {
|
||||||
script {
|
stage('Project') {
|
||||||
// Frontend and Backend
|
steps {
|
||||||
def shStatusCode = sh(label: 'Checking and Building', returnStatus: true, script: '''
|
script {
|
||||||
set -e
|
// Frontend and Backend
|
||||||
./scripts/ci/frontend-build > ${WORKSPACE}/tmp-sh-build 2>&1
|
def shStatusCode = sh(label: 'Checking and Building', returnStatus: true, script: '''
|
||||||
./scripts/ci/test-and-build > ${WORKSPACE}/tmp-sh-build 2>&1
|
set -e
|
||||||
''')
|
./scripts/ci/frontend-build > ${WORKSPACE}/tmp-sh-build 2>&1
|
||||||
shOutput = readFile "${env.WORKSPACE}/tmp-sh-build"
|
./scripts/ci/test-and-build > ${WORKSPACE}/tmp-sh-build 2>&1
|
||||||
if (shStatusCode != 0) {
|
''')
|
||||||
error "${shOutput}"
|
shOutput = readFile "${env.WORKSPACE}/tmp-sh-build"
|
||||||
|
if (shStatusCode != 0) {
|
||||||
|
error "${shOutput}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
post {
|
||||||
|
always {
|
||||||
|
sh 'rm -f ${WORKSPACE}/tmp-sh-build'
|
||||||
|
}
|
||||||
|
failure {
|
||||||
|
npmGithubPrComment("CI Error:\n\n```\n${shOutput}\n```", true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
stage('Docs') {
|
||||||
post {
|
steps {
|
||||||
always {
|
dir(path: 'docs') {
|
||||||
sh 'rm -f ${WORKSPACE}/tmp-sh-build'
|
sh 'yarn install'
|
||||||
}
|
sh 'yarn build'
|
||||||
failure {
|
}
|
||||||
npmGithubPrComment("CI Error:\n\n```\n${shOutput}\n```", true)
|
dir(path: 'docs/.vuepress/dist') {
|
||||||
|
sh 'tar -czf ../../docs.tgz *'
|
||||||
|
}
|
||||||
|
archiveArtifacts(artifacts: 'docs/docs.tgz', allowEmptyArchive: false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -140,25 +156,6 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Docs') {
|
|
||||||
when {
|
|
||||||
not {
|
|
||||||
equals expected: 'UNSTABLE', actual: currentBuild.result
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
dir(path: 'docs') {
|
|
||||||
sh 'yarn install'
|
|
||||||
sh 'yarn build'
|
|
||||||
}
|
|
||||||
|
|
||||||
dir(path: 'docs/.vuepress/dist') {
|
|
||||||
sh 'tar -czf ../../docs.tgz *'
|
|
||||||
}
|
|
||||||
|
|
||||||
archiveArtifacts(artifacts: 'docs/docs.tgz', allowEmptyArchive: false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('MultiArch Build') {
|
stage('MultiArch Build') {
|
||||||
when {
|
when {
|
||||||
not {
|
not {
|
||||||
@ -172,9 +169,9 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Docs Deploy') {
|
stage('Docs / Comment') {
|
||||||
parallel {
|
parallel {
|
||||||
stage('Master') {
|
stage('Master Docs') {
|
||||||
when {
|
when {
|
||||||
allOf {
|
allOf {
|
||||||
branch 'master'
|
branch 'master'
|
||||||
@ -187,7 +184,7 @@ pipeline {
|
|||||||
npmDocsReleaseMaster()
|
npmDocsReleaseMaster()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Develop') {
|
stage('Develop Docs') {
|
||||||
when {
|
when {
|
||||||
allOf {
|
allOf {
|
||||||
branch 'develop'
|
branch 'develop'
|
||||||
@ -200,20 +197,20 @@ pipeline {
|
|||||||
npmDocsReleaseDevelop()
|
npmDocsReleaseDevelop()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
stage('PR Comment') {
|
||||||
}
|
when {
|
||||||
stage('PR Comment') {
|
allOf {
|
||||||
when {
|
changeRequest()
|
||||||
allOf {
|
not {
|
||||||
changeRequest()
|
equals expected: 'UNSTABLE', actual: currentBuild.result
|
||||||
not {
|
}
|
||||||
equals expected: 'UNSTABLE', actual: currentBuild.result
|
}
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
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)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user