-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
95 lines (87 loc) · 1.92 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
91
92
93
94
95
include:
- project: "devops/gitlab/ci-templates/docker"
ref: "0.0.1"
file: ".build_docker_image.yml"
- project: "devops/gitlab/ci-templates/docker"
ref: "0.0.1"
file: ".push_docker_image.yml"
- project: "devops/gitlab/ci-templates/docker"
ref: "0.0.1"
file: ".remove_docker_image.yml"
- project: "devops/gitlab/ci-templates/ruby"
ref: "master"
file: ".rspec.yml"
- project: "devops/gitlab/ci-templates/ruby"
ref: "master"
file: ".rubocop.yml"
- project: "devops/gitlab/ci-templates/sast"
ref: "master"
file: ".shiftleft_container_scanning.yml"
- project: "devops/gitlab/ci-templates/sast"
ref: "master"
file: ".trivy_container_scanning.yml"
- template: "Workflows/MergeRequest-Pipelines.gitlab-ci.yml"
stages:
- .pre
- test
- sast
- push
- .post
build_image:
stage: .pre
extends:
- .build_docker_image
tags:
- build
# **Work in Progress**
# rspec_test:
# stage: test
# services:
# - mysql:5.7.31
# extends:
# - .rspec
# variables:
# RSPEC_TEST_DOCKER_ENV_VARS: "-e SECRET_KEY_BASE=x --env-file .env"
# RSPEC_TEST_PRE_SCRIPT: "bundle exec rake db:migrate"
# before_script:
# - cp ${CI_PROJECT_DIR}/.env.example ${CI_PROJECT_DIR}/.env
# tags:
# - build
rubocop:
stage: test
extends:
- .rubocop
variables:
RUBOCOP_DOCKER_ENV_VARS: "--env-file .env"
before_script:
- cp ${CI_PROJECT_DIR}/.env.example ${CI_PROJECT_DIR}/.env
tags:
- build
shiftleft_container_scanning:
stage: sast
extends:
- .shiftleft_container_scanning
tags:
- build
allow_failure: true
trivy_container_scanning:
stage: sast
extends:
- .trivy_container_scanning
tags:
- build
allow_failure: true
push_image_to_registry:
stage: push
extends:
- .push_docker_image
tags:
- build
remove_image:
stage: .post
extends:
- .remove_docker_image
rules:
- when: always
tags:
- build