-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
89 lines (80 loc) · 1.75 KB
/
.gitlab-ci.yml
File metadata and controls
89 lines (80 loc) · 1.75 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
# GitLab CI/CD configuration for msgtausch
stages:
- lint
- test
- build
- release
default:
image: docker:24.0
services:
- docker:24.0-dind
before_script:
- docker version
- docker buildx version
- docker buildx use msgtausch-builder || docker buildx create --use --driver docker-container --name msgtausch-builder
# Cache for Go modules and build cache
variables:
DOCKER_BUILDKIT: 1
DOCKER_TLS_CERTDIR: "/certs"
BUILDX_NO_DEFAULT_LOAD: "true"
# Format check stage
format:
stage: lint
script:
- docker buildx bake format
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# Lint and test stage
test:
stage: test
script:
- docker buildx bake test
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# Build stage for development version
build-dev:
stage: build
script:
- docker buildx bake build
artifacts:
paths:
- bin/
expire_in: 1 week
# Nix flake build stage
nix-build:
stage: build
script:
- docker buildx bake nix
artifacts:
paths:
- result/bin/
expire_in: 1 week
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# Build stage for merge requests
build-mr:
stage: build
script:
- docker buildx bake build
artifacts:
paths:
- bin/
expire_in: 1 day
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
# Release stage for tags
release:
stage: release
variables:
BUILD_CONFIGURATION: "release"
VERSION: "${CI_COMMIT_TAG:-dev}"
script:
- docker buildx bake release
artifacts:
paths:
- release/
rules:
- if: $CI_COMMIT_TAG