forked from AndreySenov/firebase-tools-docker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
79 lines (69 loc) · 3.47 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
# * MIT License
# Copyright (c) 2020 Tim Anthony Manuel
# forked from: https://github.com/AndreySenov/firebase-tools-docker
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# !-------------------------------------------------------------[ DEFAULTS ]---|
default:
image: docker:19.03.13
services:
- docker:19.03.13-dind
# All jobs are interruptible by default
interruptible: true
# !-------------------------------------------------------[ WORKFLOW RULES ]---|
# CONTROL THE CREATION OF PIPELINES
workflow:
rules:
- if: '$CI_COMMIT_TITLE =~ /^WIP:\ +.*$/i' # COMMIT TITLE STARTSWITH WIP:
when: never # DONT TRIGGER PIPELINE ON WIPS
- if: '$CI_COMMIT_TITLE =~ /^DOCS:\ +.*$/i' # COMMIT TITLE STARTSWITH DOCS:
when: never # DONT TRIGGER PIPELINE ON DOCS
- if: '$CI_COMMIT_TITLE =~ /^FORCES-CI:+.*$/i' # FORCE CI
- if: '$CI_COMMIT_BRANCH =~ /([1-9]\d*)+\-+[\w(\-)]*$/' # STARTSWITH DIGIT (ISSUE BRANCH)
# For merge requests, create a pipeline.
- if: '$CI_MERGE_REQUEST_IID'
# For `master` branch, create a pipeline (this includes on schedules,
# pushes, merges, etc.).
- if: '$CI_COMMIT_BRANCH == "master"'
# For tags, create a pipeline.
- if: '$CI_COMMIT_TAG'
# For stable, auto-deploy, and security branches, create a pipeline.
- if: '$CI_COMMIT_BRANCH =~ /^[\d-]+-stable(-ee)?$/'
- if: '$CI_COMMIT_BRANCH =~ /^release+(\/|-)+.*$/' # FOR RELEASES
- if: '$CI_COMMIT_BRANCH =~ /^production+(\/|-)+.*$/' # FOR PRODUCTION
- if: '$CI_COMMIT_BRANCH =~ /^staging+(\/|-)+.*$/' # FOR STAGING
- if: '$CI_COMMIT_BRANCH =~ /([1-9]\d*)+\-+[\w(\-)]*$/'
- if: '$CI_COMMIT_MESSAGE =~ / force-run-all /' # THE MAGIC WORD
- when: always
# !-----------------------------------------------------[ THE BUILD STAGES ]---|
stages:
- pre_check
- pre_build #~ WILL BE ADDED SOMETIME
- build # BUILDS THE DOCKER IMAGES
- test #~ WILL BE ADDED SOMETIME
- deploy # DEPLOY TO STAGING SERVER
- release # RELEASE TO DOCKER HUB
- communicate # FOR SENDING NOTIFICATIONS/EMAILS/ETC AFTER #?DEPLOY/RELEASE
# !---------------------------------------------[ THE VARIABLES FOR THE CI ]---|
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: '/certs'
DOCKER_HUB_ORG: thirddegreeapps
# !---------------------------------------------[ THE OTHER INCLUDED FILES ]---|
include:
- local: .gitlab/ci/builds.gitlab-ci.yml # BUILD JOBS
- local: .gitlab/ci/deploy.gitlab-ci.yml # DEPLOYMENT JOBS
# - local: .gitlab/ci/release.gitlab-ci.yml # RELEASE JOBS