.gitlab-ci.yml (view raw)
1include:
2 - project: o/infra/templates
3 file: /gitlab-ci/includes/jobs.yaml
4
5Tests:
6 stage: test
7 coverage: /All\sfiles.*?\s+(\d+.\d+)/
8 image: strapi/base:14-alpine
9 variables:
10 POSTGRES_HOST: timescale__timescaledb
11 POSTGRES_PORT: 5432
12 POSTGRES_DB: strapi_test
13 POSTGRES_USER: postgres
14 POSTGRES_PASSWORD: password
15 POSTGRES_HOST_AUTH_METHOD: trust
16 TZ: Europe/Zurich
17 services:
18 - timescale/timescaledb:latest-pg12
19 only:
20 - merge_requests
21 - master
22 - main
23 cache:
24 key: node_modules
25 paths:
26 - backend/node_modules
27 script:
28 - echo "45.66.221.1 npm-8ee.hidora.com" >> /etc/hosts
29 - cd backend
30 - yarn
31 - yarn test:ci
32
33Deploy Test:
34 extends: .deployHidora
35 rules:
36 - if: '$CI_COMMIT_REF_NAME == "master"'
37 environment:
38 name: Test
39 url: "https://caroster-dev.hidora.com"
40
41Deploy to Prod:
42 extends: .deployHidora
43 rules:
44 - if: "$CI_COMMIT_TAG =~ /v.*$/"
45 when: manual
46 environment:
47 name: Prod
48 url: https://app.caroster.io