forked from SocialGouv/1000jours
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
90 lines (81 loc) · 2.24 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
81
82
83
84
85
86
87
88
89
90
include:
- project: SocialGouv/gitlab-ci-yml
file: /autodevops.yml
ref: v23.3.0
variables:
AUTO_DEVOPS_KANIKO: "✔️"
AUTO_DEVOPS_RELEASE_AUTO: "✔️"
# AUTO_DEVOPS_PRODUCTION_AUTO: "✔️"
AUTO_DEVOPS_ENABLE_KAPP: "✔️"
AUTO_DEVOPS_TEST_DISABLED: "🛑"
AUTO_DEVOPS_QUALITY_DISABLED: "🛑"
AUTO_DEVOPS_NOTIFY_DISABLED: "🛑"
Lint:
rules:
- when: never
Build:
rules:
- when: never
Register Kaniko image:
rules:
- when: never
K8S Test:
extends: .autodevops_k8s_test
rules:
- if: "$PRODUCTION || $RELEASE"
when: never
# NOTE(douglasduteil): ensure to run k8s test
# - if: "$AUTO_DEVOPS_TEST_DISABLED"
# when: never
- exists:
- .k8s/package.json
Register strapi:
extends: .autodevops_register_kaniko_image
needs: []
dependencies: []
variables:
CONTEXT: back/strapi
IMAGE_NAME: les1000jours-strapi
# restore develop database on review branches
Restore develop db:
extends: .autodevops_review
stage: .post
allow_failure: True
variables:
KOSKO_APPEND_YAML_FROM: ""
KOSKO_GENERATE_ARGS: "--env dev jobs/restore"
KAPP_DEPLOY_ARGS: "-a ${CI_PROJECT_NAME}-restore-develop-db"
environment:
auto_stop_in: 15 day
name: ${CI_COMMIT_REF_NAME}${AUTO_DEVOPS_DEV_ENVIRONMENT_NAME}
on_stop: Stop review
url: https://${CI_ENVIRONMENT_SLUG}-${CI_PROJECT_NAME}.${KUBE_INGRESS_BASE_DOMAIN}
rules:
- if: "$CI_COMMIT_BRANCH == 'develop'"
when: never
- if: "$CI_COMMIT_TAG"
when: never
- when: always
Review:
extends: .autodevops_review
# add an exception for the develop branch (permanent env)
rules:
- if: "$PRODUCTION || $TRIGGER || $CI_COMMIT_TAG"
when: never
- if: "$CI_COMMIT_BRANCH == 'develop'"
when: never
- when: on_success
# longer env lifetime for develop branch
Review develop:
extends: .autodevops_review
rules:
- if: "$PRODUCTION || $TRIGGER || $CI_COMMIT_TAG"
when: never
- if: "$CI_COMMIT_BRANCH == 'develop'"
when: on_success
- when: never
environment:
auto_stop_in: 15 day
name: ${CI_COMMIT_REF_NAME}${AUTO_DEVOPS_DEV_ENVIRONMENT_NAME}
on_stop: Stop review
url: https://${CI_ENVIRONMENT_SLUG}-${CI_PROJECT_NAME}.${KUBE_INGRESS_BASE_DOMAIN}