diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 985ae5a7f29398e4d7090654b7cf11337b0bdc80..fd9e3c0687443822b7778182fc681173efeeff08 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -54,13 +54,5 @@ run pipeline: image: python:alpine before_script: - apk add --update curl jq - variables: - RUN_DECOMPOSED: 'false' script: - ./misc/trigger-test-pipeline.sh - -run pipeline decomposed: - extends: - - run pipeline - variables: - RUN_DECOMPOSED: 'true' \ No newline at end of file diff --git a/db-testing.yml b/db-testing.yml index edb5ef293b5dcea4121e2888f60fdc89cb850e1b..2643427e4fab550826f468c5f5767081be467bd1 100644 --- a/db-testing.yml +++ b/db-testing.yml @@ -17,15 +17,6 @@ variables: tags: - builder -.rules:if-decomposed: - rules: - - if: '$RUN_DECOMPOSED == "true"' - -.rules:if-not-decomposed: - rules: - - if: '$RUN_DECOMPOSED == "true"' - when: never - image:gitlab: extends: .image:base script: @@ -51,7 +42,7 @@ image:redis: - docker tag ${IMAGE_NAME} ${DOCKER_REGISTRY}/${IMAGE_NAME} - docker push ${DOCKER_REGISTRY}/${IMAGE_NAME} -.db:migrations:base: +db:migrations: stage: test image: ${DOCKER_REGISTRY}/$IMAGE_NAME tags: @@ -65,7 +56,11 @@ image:redis: DBLAB_API_PORT: $DBLAB_API_PORT DBLAB_ENVIRONMENT: $DBLAB_ENVIRONMENT DBLAB_CLONE_ID: "database-testing-${CI_PIPELINE_ID}" - CLONE_DETAILS_DB_NAME: "postgres" # temporary to make clone_details work with multiple databases + services: + - name: ${DOCKER_REGISTRY}/gitlab-com-database-testing-dblab-ssh:latest + alias: postgres + - name: ${DOCKER_REGISTRY}/redis:4.0-alpine + alias: redis artifacts: paths: - migration-testing/ @@ -79,40 +74,15 @@ image:redis: - bundle exec rake gitlab:db:migration_testing:up | tee tmp/migration-testing/up/full-migration-output.log || true - mv tmp/migration-testing/ ${CI_PROJECT_DIR} - bundle exec ruby list_migrations.rb > ${CI_PROJECT_DIR}/migration-testing/migrations.json - - bundle exec ruby clone_details.rb ${CLONE_DETAILS_DB_NAME} > ${CI_PROJECT_DIR}/migration-testing/clone-details.json - -db:migrations: - extends: - - .db:migrations:base - - .rules:if-not-decomposed - services: - - name: ${DOCKER_REGISTRY}/gitlab-com-database-testing-dblab-ssh:latest - alias: postgres - - name: ${DOCKER_REGISTRY}/redis:4.0-alpine - alias: redis - -db:migrations decomposed: - extends: - - .db:migrations:base - - .rules:if-decomposed - variables: - CLONE_DETAILS_DB_NAME: "postgres-main" # Temporary to make clone_details script work - services: - - name: ${DOCKER_REGISTRY}/gitlab-com-database-testing-dblab-ssh:latest - alias: postgres-main - variables: - DBLAB_CLONE_ID: "database-testing-${CI_PIPELINE_ID}-main" - - name: ${DOCKER_REGISTRY}/gitlab-com-database-testing-dblab-ssh:latest - alias: postgres-ci - variables: - DBLAB_CLONE_ID: "database-testing-${CI_PIPELINE_ID}-ci" - - name: ${DOCKER_REGISTRY}/redis:4.0-alpine - alias: redis + - bundle exec ruby clone_details.rb postgres > ${CI_PROJECT_DIR}/migration-testing/clone-details.json notify-upstream: stage: final tags: - builder + needs: + - job: db:migrations + artifacts: true # Also store artifacts here so we can easily generate direct links to them artifacts: paths: diff --git a/docker/gitlab/prepare.sh b/docker/gitlab/prepare.sh index cbe677b4cc99a6cf03c2143dbbea928de541f535..df154fff9da2368c535d916a0c20fa913d5def10 100755 --- a/docker/gitlab/prepare.sh +++ b/docker/gitlab/prepare.sh @@ -3,36 +3,7 @@ cp config/gitlab.yml.example config/gitlab.yml sed -i 's/bin_path: \/usr\/bin\/git/bin_path: \/usr\/local\/bin\/git/' config/gitlab.yml -if test "$RUN_DECOMPOSED"; then - echo 'using decomposed database.yml' - - cat > config/database.yml <<-EOF -test: &test - main: - adapter: postgresql - encoding: unicode - database: gitlabhq_dblab - username: ${DBLAB_USER} - password: ${DBLAB_PASSWORD} - host: postgres-main - prepared_statements: false - variables: - statement_timeout: 120s - ci: - adapter: postgresql - encoding: unicode - database: gitlabhq_dblab - username: ${DBLAB_USER} - password: ${DBLAB_PASSWORD} - host: postgres-ci - prepared_statements: false - variables: - statement_timeout: 120s -EOF -else - echo 'using single database database.yml' - - cat > config/database.yml <<-EOF +cat > config/database.yml <<-EOF test: &test adapter: postgresql encoding: unicode @@ -45,8 +16,6 @@ test: &test statement_timeout: 120s EOF -fi - if test "$VALIDATION_PIPELINE"; then echo "Applying test patch" git am < /gitlab/patches/testing/New-Table-Migration.patch diff --git a/misc/trigger-test-pipeline.sh b/misc/trigger-test-pipeline.sh index e6f23eea2083356d23808654c7ea36b3d82f0fe1..84a4ea28bdb000e81fe2b7e5c0cd155f98e02165 100755 --- a/misc/trigger-test-pipeline.sh +++ b/misc/trigger-test-pipeline.sh @@ -23,5 +23,4 @@ curl --fail-with-body \ --form "variables[VALIDATION_PIPELINE]=true" \ --form "variables[GITLAB_COMMIT_SHA]=$SHA" \ --form "variables[TRIGGER_SOURCE]=$CI_JOB_URL" \ - --form "variables[RUN_DECOMPOSED]=$RUN_DECOMPOSED" \ "https://ops.gitlab.net/api/v4/projects/429/trigger/pipeline"