60 lines
1.4 KiB
YAML
60 lines
1.4 KiB
YAML
stages:
|
|
- build
|
|
- test
|
|
- deploy
|
|
|
|
include:
|
|
- project: 'turniere/turniere-infra'
|
|
file: '/ci/pipeline.yaml'
|
|
|
|
rails spec:
|
|
stage: test
|
|
image: $CI_REGISTRY_IMAGE/test/commits:$CI_COMMIT_SHA
|
|
rules:
|
|
- if: $SKIP_TEST
|
|
when: never
|
|
- if: $CI_PIPELINE_SOURCE != "push"
|
|
when: never
|
|
- when: always
|
|
script:
|
|
- cd /app
|
|
- inv db-migrate
|
|
- inv test
|
|
artifacts:
|
|
paths:
|
|
- specs_with_runtime.txt
|
|
expire_in: 30 days
|
|
|
|
rails e2e spec:
|
|
stage: test
|
|
image: $CI_REGISTRY_IMAGE/test/commits:$CI_COMMIT_SHA
|
|
services:
|
|
- name: postgres:16
|
|
alias: postgres
|
|
- name: $CI_REGISTRY_IMAGE/production/commits:$CI_COMMIT_SHA
|
|
alias: app
|
|
variables:
|
|
POSTGRES_DB: turniere_blackbox
|
|
POSTGRES_USER: turniere
|
|
POSTGRES_PASSWORD: turniere
|
|
POSTGRES_URL: postgres://turniere:turniere@postgres:5432/turniere_blackbox
|
|
POSTGRES_USERNAME: turniere
|
|
SECRET_KEY_BASE: turniere-blackbox-secret-key-base-please-change-in-real-prod
|
|
MAILGUN_API_KEY: blackbox-test-api-key
|
|
MAILGUN_DOMAIN: blackbox.example.com
|
|
RAILS_LOG_TO_STDOUT: "1"
|
|
RAILS_SERVE_STATIC_FILES: "1"
|
|
TURNIERE_E2E_BASE_URL: http://app:3000
|
|
TURNIERE_E2E_EMAIL: e2e@example.com
|
|
TURNIERE_E2E_PASSWORD: password123
|
|
TURNIERE_E2E_USERNAME: e2e-user
|
|
rules:
|
|
- if: $SKIP_TEST
|
|
when: never
|
|
- if: $CI_PIPELINE_SOURCE != "push"
|
|
when: never
|
|
- when: always
|
|
script:
|
|
- cd /app
|
|
- inv blackbox-service
|