-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
66 lines (66 loc) · 2.12 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
---
stages: [checks, update, build]
variables:
GIT_AUTHOR_EMAIL: [email protected]
GIT_AUTHOR_NAME: Gitlab CI
GIT_STRATEGY: clone
REPO_URL: $CI_SERVER_PROTOCOL://gitlab-ci-token:$ACCESS_TOKEN@$CI_SERVER_HOST/$CI_PROJECT_PATH.git
check-lint:
# Check all files for common anti-patterns and issues
stage: checks
image: nixpkgs/nix-flakes:latest
inherit:
variables: false
script:
- nix flake check --all-systems || true
- nix run nixpkgs#commitizen -- check --message "$CI_COMMIT_MESSAGE"
rules:
- if: $UPDATE_BUILDER != "1"
check-pr-commitizen:
# Check the current commit message for compliance with commitizen
stage: checks
image: nixpkgs/nix-flakes:latest
inherit:
variables: false
script:
- nix run nixpkgs#commitizen -- check --message "$CI_COMMIT_MESSAGE"
rules:
- if: $UPDATE_BUILDER != "1"
build-builder:
# Used to deploy a new base Docker image for building purposes,
# this one runs once per day via pipeline schedules
stage: build
image: docker:27-cli
services:
- name: docker:27-dind
alias: docker-daemon
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
- docker build -t "$CI_REGISTRY_IMAGE/builder:latest" ./builder-container
- docker push "$CI_REGISTRY_IMAGE/builder:latest"
tags: [dind]
variables:
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker-daemon:2375/
DOCKER_TLS_CERTDIR: ''
rules:
- changes: [builder-container/*]
if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $UPDATE_BUILDER == "1"
build-manager:
stage: build
image: docker:27-cli
services:
- name: docker:27-dind
alias: docker-daemon
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
- docker build -t "$CI_REGISTRY_IMAGE/manager:latest" -f Dockerfile .
- docker push "$CI_REGISTRY_IMAGE/manager:latest"
tags: [dind]
variables:
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker-daemon:2375/
DOCKER_TLS_CERTDIR: ''
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $UPDATE_BUILDER != "1"