43 lines
777 B
YAML
43 lines
777 B
YAML
#image: docker:19.03.12
|
|
|
|
# Change pip's cache directory to be inside the project directory since we can
|
|
# only cache local items.
|
|
variables:
|
|
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
|
CI_DEBUG_TRACE: "true"
|
|
REPO: docker.shillerben.com
|
|
TAG: latest
|
|
|
|
cache:
|
|
paths:
|
|
- .cache/pip
|
|
|
|
stages:
|
|
- test
|
|
- build
|
|
- push
|
|
|
|
test:
|
|
image: python:3.8
|
|
stage: test
|
|
before_script:
|
|
- apt-get update && apt-get install python3
|
|
- python3 -V
|
|
- python3 -m pip install -r requirements.txt
|
|
- python3 -m pip install pytest
|
|
script:
|
|
- pytest
|
|
|
|
build:
|
|
image: docker:19.03.12
|
|
stage: build
|
|
script:
|
|
- docker build -t my_homepage .
|
|
|
|
push:
|
|
image: docker:19.03.12
|
|
stage: push
|
|
script:
|
|
- docker tag my_homepage $REPO/my_homepage:$TAG
|
|
- docker push $REPO/my_homepage:$TAG
|