-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
45 lines (41 loc) · 985 Bytes
/
.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
image: python:3
stages:
- code quality
- build
variables:
DOCKER_HUB_REPO: "hedius/discordvoicestatus"
flake8:
stage: code quality
tags:
- docker
script:
- python -m pip install flake8
- flake8 voicestatus
Pylama:
stage: code quality
tags:
- docker
script:
- python -m pip install pylama
- pylama voicestatus
docker-build:
# Official docker image.
image: docker:latest
stage: build
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker login -u "$DOCKER_HUB_USERNAME" -p "$DOCKER_HUB_PASSWORD"
script:
- |
if [ -z "$CI_COMMIT_TAG" ]; then
TAG="latest"
else
TAG="$CI_COMMIT_TAG"
fi
- docker build --pull -t "$CI_REGISTRY_IMAGE:$TAG" -t "$DOCKER_HUB_REPO:$TAG" .
- docker push $CI_REGISTRY_IMAGE:$TAG
- docker push $DOCKER_HUB_REPO:$TAG
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH