only lint if python has been updated
This commit is contained in:
parent
67cb3a8aa6
commit
84f30e5383
37
.gitlab-ci.sync-conflict-20220202-171850-Z6PPTMH.yml
Executable file
37
.gitlab-ci.sync-conflict-20220202-171850-Z6PPTMH.yml
Executable file
@ -0,0 +1,37 @@
|
||||
image: docker:19.03.12-dind
|
||||
services:
|
||||
- name: docker:dind
|
||||
entrypoint: ["env", "-u", "DOCKER_HOST"]
|
||||
command: ["dockerd-entrypoint.sh"]
|
||||
variables:
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
DOCKER_HOST: tcp://docker:2375/
|
||||
DOCKER_DRIVER: overlay2
|
||||
|
||||
stages:
|
||||
- test
|
||||
- deploy
|
||||
|
||||
lint_python_on_merge_request:
|
||||
image: python:alpine
|
||||
stage: test
|
||||
script:
|
||||
- echo "Linting Python code"
|
||||
- pip install --upgrade -q pip && pip install -q black && black --fast --check .
|
||||
rules:
|
||||
- changes:
|
||||
- app/*
|
||||
|
||||
build_and_push_container:
|
||||
stage: deploy
|
||||
script:
|
||||
- echo "Wait for Docker daemon at tcp://localhost:2375"
|
||||
- while ! nc -z localhost 2375; do sleep 0.1; done # Wait until docker socket is available
|
||||
- docker login -u ldooks -p $DOCKER_ACCESS_TOKEN
|
||||
- docker build -t ldooks/dragon-bot:$CI_PIPELINE_ID -t ldooks/dragon-bot:latest .
|
||||
- docker push ldooks/dragon-bot:latest
|
||||
- docker push ldooks/dragon-bot:$CI_PIPELINE_ID
|
||||
rules:
|
||||
- changes:
|
||||
- app/*
|
||||
- Dockerfile
|
3
.gitlab-ci.yml
Executable file → Normal file
3
.gitlab-ci.yml
Executable file → Normal file
@ -18,6 +18,9 @@ lint_python_on_merge_request:
|
||||
script:
|
||||
- echo "Linting Python code"
|
||||
- pip install --upgrade -q pip && pip install -q black && black --fast --check .
|
||||
rules:
|
||||
- changes:
|
||||
- app/*
|
||||
|
||||
build_and_push_container:
|
||||
stage: deploy
|
||||
|
Loading…
x
Reference in New Issue
Block a user