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