-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
66 lines (62 loc) · 1.81 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:
- build
- build docker
build:
image: dock.mau.dev/tulir/gomuks-build-docker:linux-amd64
stage: build
cache:
paths:
- .cache
before_script:
- mkdir -p .cache
- export GOPATH="$CI_PROJECT_DIR/.cache"
script:
- go build -ldflags "-linkmode external -extldflags -static" -o mediaviewer
artifacts:
paths:
- mediaviewer
build docker:
image: docker:stable
stage: build docker
services:
- docker:dind
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- docker pull $CI_REGISTRY_IMAGE:latest || true
- docker build --pull --cache-from $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA . --file Dockerfile.ci
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- if [ "$CI_COMMIT_BRANCH" = "main" ]; then docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:latest && docker push $CI_REGISTRY_IMAGE:latest; fi
- if [ "$CI_COMMIT_BRANCH" != "main" ]; then docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME && docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME; fi
build maubot:
variables:
PYTHONPATH: /opt/maubot
image: dock.mau.dev/maubot/maubot
stage: build
only:
changes:
- maubot
- .gitlab-ci.yml
except:
- tags
script:
- cd maubot
- python3 -m maubot.cli build -o xyz.maubot.$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA.mbp
artifacts:
paths:
- "maubot/*.mbp"
expire_in: 365 days
build maubot (tag):
variables:
PYTHONPATH: /opt/maubot
image: dock.mau.dev/maubot/maubot
stage: build
only:
- tags
script:
- cd maubot
- python3 -m maubot.cli build -o xyz.maubot.$CI_PROJECT_NAME-$CI_COMMIT_TAG.mbp
artifacts:
paths:
- "maubot/*.mbp"
expire_in: never