-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
48 lines (40 loc) · 1.12 KB
/
.gitlab-ci.yml
File metadata and controls
48 lines (40 loc) · 1.12 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
stages:
- build
- deploy
Build Image:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
rules:
- if: $CI_COMMIT_TAG
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(echo -n ${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD} | base64)\"}}}" > /kaniko/.docker/config.json
- >-
/kaniko/executor
--context $CI_PROJECT_DIR
--destination $CI_REGISTRY_IMAGE:v$CI_COMMIT_TAG
--destination $CI_REGISTRY_IMAGE:latest
Release:
stage: deploy
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
script:
- echo "running release"
release:
name: 'WebWatcher $CI_COMMIT_TAG'
description: 'v$CI_COMMIT_TAG release of WebWatcher.'
tag_name: '$CI_COMMIT_TAG'
ref: '$CI_COMMIT_TAG'
Upload to PyPi:
stage: deploy
image: python:3.10
rules:
- if: $CI_COMMIT_TAG
script:
- pip install twine wheel
- sed -i "s/CI_COMMIT_TAG/${CI_COMMIT_TAG}/g" setup.py
- python setup.py sdist
- python -m twine upload dist/* -u $PYPI_USERNAME -p $PYPI_PASSWORD