-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
55 lines (48 loc) · 1.27 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
stages:
- build
- publish
- release
variables:
DOCKER_AUTH_CONFIG: $DOCKER_AUTH_CONFIG_HARBOR
image: $IMAGE_REPOSITORY/python:3.11-alpine
.env_before_script: &env_before_script
before_script:
- pip install -U pip
- pip install 'twine>=4.0.1'
.build_env_before_script: &build_env_before_script
before_script:
- export BUILD_VERSION=$(echo ${CI_COMMIT_TAG:-v0.0.1} | tr -d v)
build_universal:
stage: build
<<: *env_before_script
<<: *build_env_before_script
script:
- python3 setup.py bdist_wheel --universal
artifacts:
paths:
- dist
only:
- tags
publish_universal:
stage: publish
<<: *env_before_script
script:
- twine upload -p pypi-$TWINE_TOKEN --disable-progress-bar dist/*
needs:
- build_universal
only:
- tags
docker_image_release:
stage: release
image: $IMAGE_REPOSITORY/docker:latest
<<: *build_env_before_script
script:
- docker login -u "$DOCKERHUB_USER" -p "$DOCKERHUB_TOKEN"
- docker build --no-cache --build-arg BUILD_VERSION -t "$DOCKERHUB_USER/certbot-dns-norisnetwork:latest" -t "$DOCKERHUB_USER/certbot-dns-norisnetwork:$BUILD_VERSION" .
- docker push -a "$DOCKERHUB_USER/certbot-dns-norisnetwork"
when: delayed
start_in: 300 seconds
needs:
- publish_universal
only:
- tags