forked from Dragios/Discord-Bot
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
129 lines (117 loc) · 3.7 KB
/
.gitlab-ci.yml
File metadata and controls
129 lines (117 loc) · 3.7 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# Define the Docker in Docker anchor.
.dind: &dind
variables:
# Set the Docker host to the network connection to the dind service instead of the usual socket.
DOCKER_HOST: tcp://docker:2375/
# Run in the official Docker image.
image: docker
services:
# Enable the Docker service.
- docker:dind
# Define the stages.
stages:
# Create a static code analysis stage.
- analyze
# Create an app package building stage.
- build
# Create an app package deploying stage.
- deploy
analysis:ec:
# Add to the analysis stage.
stage: analyze
# Use the latest ec Docker image.
image: mstruebing/editorconfig-checker:latest
# Check that all text complies with the EditorConfig file.
script: ec
analysis:shfmt:
# Add to the analysis stage.
stage: analyze
# Use the latest Alpine Linux shfmt Docker image.
image: mvdan/shfmt:latest-alpine
rules:
- changes:
# Watch for changes in the CI scripts.
- "CI/**/*.sh"
# Check that all Bash code has proper formatting.
script: shfmt -d .
analysis:shellcheck:
# Add to the analysis stage.
stage: analyze
# Use the latest stable ShellCheck Docker image.
image: koalaman/shellcheck-alpine:stable
rules:
- changes:
# Watch for changes in the CI scripts.
- "CI/**/*.sh"
# Check that all Bash code is proper.
script: shellcheck -x **/*.sh
# Define the Docker image building anchor. Since there's already a Docker in Docker anchor, this
# should only define elements needed for building.
.build:docker: &docker_build
<<: *dind
# Any Docker image building will be a part of the package building stage, so add it.
stage: build
artifacts:
# Save the built image.
paths: [Build/]
# Run the Docker build script.
script: CI/build.sh
# Define the Docker AMD64 image building job.
build:docker:amd64:
<<: *docker_build
variables:
# Set the target architecture to AMD64. This will be able to run on most desktop platforms.
TARGET_ARCH: amd64
# Define the Docker ARMv7 image building job.
build:docker:arm32v7:
<<: *docker_build
variables:
# Set the target architecture to ARMv7 32 bit. This will be able to run on some embedded
# platforms, such as the Raspberry Pi 2 v1.1 model.
TARGET_ARCH: arm32v7
# Define the Docker ARMv8 image building job.
build:docker:arm64v8:
<<: *docker_build
variables:
# Set the target architecture to ARMv8 64 bit. This will be able to run on some embedded
# platforms, such as the Raspberry Pi 2 v1.2 model and the Raspberry Pi 3 models.
TARGET_ARCH: arm64v8
# Define the Docker image deploying anchor.
.deploy:docker: &docker_deploy
<<: *dind
# Add to the deploying stage.
stage: deploy
variables:
# Don't clone or fetch the Git repo, as the dependencies are all that's needed here.
GIT_STRATEGY: none
only:
# Only deploy on the "master" branch.
- master
# Make sure tags are deployed.
- tags
# Run the deploying script.
script: ./CI/deploy.sh
# Define the Docker AMD64 image deploying job.
deploy:docker:amd64:
<<: *docker_deploy
variables:
# Set the target architecture to AMD64. This will be able to run on most desktop platforms.
TARGET_ARCH: amd64
# Require the AMD64 build job.
needs: ["build:docker:amd64"]
# Define the Docker ARMv7 image deploying job.
deploy:docker:arm32v7:
<<: *docker_deploy
variables:
# Set the target architecture to ARMv7 32 bit.
TARGET_ARCH: arm32v7
# Require the ARMv7 build job.
needs: ["build:docker:arm32v7"]
# Define the Docker ARMv8 image deploying job.
deploy:docker:arm64v8:
<<: *docker_deploy
variables:
# Set the target architecture to ARMv8.
TARGET_ARCH: arm64v8
# Require the ARMv8 build job.
needs: ["build:docker:arm64v8"]