image: docker:stable variables: DOCKER_TLS_CERTDIR: "/certs" include: - project: "operator-ict/devops/gitlab-ci-pipeline" file: - "/code-quality/sonar-cloud.yml" - "/npm/publish.yml" stages: - test - deploy migration_psql_up_down_test: stage: test image: node:18.17.0-alpine services: - name: postgis/postgis:14-3.3-alpine alias: postgres variables: POSTGRES_HOST: postgres POSTGRES_USER: postgres POSTGRES_PASSWORD: test-pass POSTGRES_DB: testdb2 script: - export POSTGRES_CONN=postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/$POSTGRES_DB - npm install --ignore-scripts --progress=false - npx db-migrate up --env postgresql --migrations-dir db/postgresql-migrations --force-exit >/dev/null - npx db-migrate reset --env postgresql --migrations-dir db/postgresql-migrations --force-exit >/dev/null rules: - if: $CI_COMMIT_BRANCH == "master" - if: $CI_COMMIT_BRANCH == "development" - if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME tags: - docker