stages: [lint, build, deploy]

.default_lint:
  stage: lint
  image: alpine:3.20
  script:
    - echo "run shared lint logic"

lint_service_a:
  extends: .default_lint
  variables:
    SERVICE_DIR: service-a

lint_service_b:
  extends: .default_lint
  variables:
    SERVICE_DIR: service-b

deploy_prod:
  stage: deploy
  resource_group: production
  script:
    - ./deploy.sh
  when: manual

smoke_test:
  stage: build
  allow_failure:
    exit_codes:
      - 42
  script:
    - ./smoke-test.sh

parallel_tests:
  stage: build
  parallel: 4
  script:
    - ./run-tests.sh

matrix_build:
  stage: build
  parallel:
    matrix:
      - PROVIDER: [aws, gcp]
        STACK: [app, monitoring]
  script:
    - ./build.sh "$PROVIDER" "$STACK"
