Skip to content

Commit

Permalink
Run the tests in Jenkins (#3967)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanIvanoff authored Nov 2, 2023
1 parent 0a32928 commit 392a863
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ slaveTemplates.dockerTemplate { label ->
def scmVars = checkout scm
def gitHead = scmVars.GIT_COMMIT.substring(0, 7)

// sh "docker build \
// -t sanbase-test:${scmVars.GIT_COMMIT}-${env.BUILD_ID}-${env.BRANCH_NAME}-${env.CHANGE_ID} \
// -f Dockerfile-test . \
// --progress plain"
sh "docker build \
-t sanbase-test:${scmVars.GIT_COMMIT}-${env.BUILD_ID}-${env.BRANCH_NAME}-${env.CHANGE_ID} \
-f Dockerfile-test . \
--progress plain"

// sh "docker run \
// --rm --name test-postgres-${scmVars.GIT_COMMIT}-${env.BUILD_ID}-${env.BRANCH_NAME}-${env.CHANGE_ID} \
// -e POSTGRES_PASSWORD=password \
// -d postgres:12.7-alpine"
sh "docker run \
--rm --name test-postgres-${scmVars.GIT_COMMIT}-${env.BUILD_ID}-${env.BRANCH_NAME}-${env.CHANGE_ID} \
-e POSTGRES_PASSWORD=password \
-d postgres:12.7-alpine"

// try {
// sh "docker run --rm \
// --link test-postgres-${scmVars.GIT_COMMIT}-${env.BUILD_ID}-${env.BRANCH_NAME}-${env.CHANGE_ID}:test-db \
// --env DATABASE_URL=postgres://postgres:password@test-db:5432/postgres \
// -t sanbase-test:${scmVars.GIT_COMMIT}-${env.BUILD_ID}-${env.BRANCH_NAME}-${env.CHANGE_ID}"
// } finally {
// sh "docker kill test-postgres-${scmVars.GIT_COMMIT}-${env.BUILD_ID}-${env.BRANCH_NAME}-${env.CHANGE_ID}"
// }
try {
sh "docker run --rm \
--link test-postgres-${scmVars.GIT_COMMIT}-${env.BUILD_ID}-${env.BRANCH_NAME}-${env.CHANGE_ID}:test-db \
--env DATABASE_URL=postgres://postgres:password@test-db:5432/postgres \
-t sanbase-test:${scmVars.GIT_COMMIT}-${env.BUILD_ID}-${env.BRANCH_NAME}-${env.CHANGE_ID}"
} finally {
sh "docker kill test-postgres-${scmVars.GIT_COMMIT}-${env.BUILD_ID}-${env.BRANCH_NAME}-${env.CHANGE_ID}"
}

if (env.BRANCH_NAME == 'master') {
withCredentials([
Expand Down

0 comments on commit 392a863

Please sign in to comment.