-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
80 lines (71 loc) · 1.89 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# You can copy and paste this template into a new `.gitlab-ci.yml` file.
build-backend:
stage: build
image: "rust:latest"
services:
- postgres:latest
script:
- rustc --version && cargo --version # Print version info for debugging
- cargo build --workspace --verbose
variables:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: admin
POSTGRES_HOST_AUTH_METHOD: trust
build-frontend:
stage: build
image: "node:latest"
script:
- cd frontend && npm i && npm run build
test-backend:
stage: test
image: "rust:latest"
services:
- postgres:latest
script:
- rustc --version && cargo --version # Print version info for debugging
- cargo test --workspace --verbose
variables:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: admin
POSTGRES_HOST_AUTH_METHOD: trust
deploy-backend:
stage: deploy
image:
name: gcr.io/kaniko-project/executor:v1.23.2-debug
entrypoint: [""]
script:
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
rules:
- if: $CI_COMMIT_TAG
deploy-frontend:
stage: deploy
image:
name: gcr.io/kaniko-project/executor:v1.23.2-debug
entrypoint: [""]
script:
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/frontend/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}_frontend"
rules:
- if: $CI_COMMIT_TAG
changelog:
image:
name: orhunp/git-cliff:latest
entrypoint: [""]
variables:
GIT_STRATEGY: clone # clone entire repo instead of reusing workspace
GIT_DEPTH: 0 # avoid shallow clone to give cliff all the info it needs
stage: deploy
script:
- git-cliff -r . > CHANGELOG.md
artifacts:
paths:
- CHANGELOG.md
rules:
- if: $CI_COMMIT_TAG