-
Notifications
You must be signed in to change notification settings - Fork 7
/
.gitlab-ci.yml
42 lines (39 loc) · 1.21 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
stages:
- build_and_tag
variables:
GIT_STRATEGY: "clone"
job-build:
stage: build_and_tag
image: docker:25.0.3-cli-alpine3.19
services:
- docker:dind
script:
- apk update && apk add python3 py3-pip
- python3 -m pip install poetry --break-system-packages
- python3 -m poetry config virtualenvs.create false
- python3 -m poetry install --no-root
- export PYTHONPATH=$(pwd)
- python3 scripts/run_tests.py
- python3 scripts/multi_build.py
artifacts:
paths:
- "multi-build/zero-*.zip"
when: on_success
expire_in: never
rules:
- when: manual
job-tag:
stage: build_and_tag
script:
- USERNAME="$CUSTOM_CI_USERNAME"
- PASSWORD="$CUSTOM_CI_PASSWORD"
- EMAIL="$CUSTOM_CI_EMAIL"
- TAGNAME="v$(sh scripts/get_version.sh)"
- git config --global user.name "${USERNAME}"
- git config --global user.email "${EMAIL}"
- git remote remove origin
- git remote add origin https://${USERNAME}:${PASSWORD}@gitlab.com/${CI_PROJECT_PATH}
- if [ $(git tag | grep "$TAGNAME") ]; then echo "[ * ] Tag already exists, skipping.."; else git tag $TAGNAME && git push origin $TAGNAME; fi
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- when: manual