Cleanup CI file

This commit is contained in:
Jamie Curnow 2023-05-31 21:44:06 +10:00
parent b2592d9351
commit ac8fa0d737
No known key found for this signature in database
GPG Key ID: FFBB624C43388E9E

31
Jenkinsfile vendored
View File

@ -77,28 +77,10 @@ pipeline {
steps { steps {
withCredentials([string(credentialsId: 'npm-sentry-dsn', variable: 'SENTRY_DSN')]) { withCredentials([string(credentialsId: 'npm-sentry-dsn', variable: 'SENTRY_DSN')]) {
withCredentials([usernamePassword(credentialsId: 'oss-index-token', passwordVariable: 'NANCY_TOKEN', usernameVariable: 'NANCY_USER')]) { withCredentials([usernamePassword(credentialsId: 'oss-index-token', passwordVariable: 'NANCY_TOKEN', usernameVariable: 'NANCY_USER')]) {
script { sh './scripts/ci/test-backend'
def shStatusCode = sh(label: 'test-backend', returnStatus: true, script: '''
set -e
./scripts/ci/test-backend | sed -r "s/\\x1B\\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" > ${WORKSPACE}/tmp-sh-build 2>&1
''')
shOutput = readFile "${env.WORKSPACE}/tmp-sh-build"
if (shStatusCode != 0) {
error "${shOutput}"
}
}
} }
// Build all the golang binaries // Build all the golang binaries
script { sh './scripts/ci/build-backend'
def shStatusCode = sh(label: 'build-backend', returnStatus: true, script: '''
set -e
./scripts/ci/build-backend > ${WORKSPACE}/tmp-sh-build 2>&1
''')
shOutput = readFile "${env.WORKSPACE}/tmp-sh-build"
if (shStatusCode != 0) {
error "${shOutput}"
}
}
// Build the docker image used for testing below // Build the docker image used for testing below
sh '''docker build --pull --no-cache \\ sh '''docker build --pull --no-cache \\
-t "${IMAGE}:${BRANCH_LOWER}-ci-${BUILD_NUMBER}" \\ -t "${IMAGE}:${BRANCH_LOWER}-ci-${BUILD_NUMBER}" \\
@ -111,12 +93,6 @@ pipeline {
} }
} }
post { post {
always {
sh 'rm -f ${WORKSPACE}/tmp-sh-build'
}
failure {
npmGithubPrComment("CI Error:\n\n```\n${shOutput}\n```", true)
}
success { success {
archiveArtifacts allowEmptyArchive: false, artifacts: 'bin/*' archiveArtifacts allowEmptyArchive: false, artifacts: 'bin/*'
script { script {
@ -136,7 +112,6 @@ pipeline {
} }
} }
steps { steps {
sh 'docker-compose config'
sh 'rm -rf ./test/results/junit/*' sh 'rm -rf ./test/results/junit/*'
sh './scripts/ci/fulltest-cypress' sh './scripts/ci/fulltest-cypress'
} }
@ -167,7 +142,6 @@ pipeline {
} }
} }
steps { steps {
sh 'docker-compose config'
sh 'rm -rf ./test/results/junit/*' sh 'rm -rf ./test/results/junit/*'
sh './scripts/ci/fulltest-cypress' sh './scripts/ci/fulltest-cypress'
} }
@ -196,7 +170,6 @@ pipeline {
} }
} }
steps { steps {
sh 'docker-compose config'
sh 'rm -rf ./test/results/junit/*' sh 'rm -rf ./test/results/junit/*'
sh './scripts/ci/fulltest-cypress' sh './scripts/ci/fulltest-cypress'
} }