30 lines
851 B
YAML
30 lines
851 B
YAML
variables:
|
|
DOCKER_HOST: tcp://docker:2375/
|
|
DOCKER_DRIVER: overlay2
|
|
DOCKER_TLS_CERTDIR: ""
|
|
|
|
pytest:
|
|
stage: test
|
|
tags:
|
|
- python
|
|
script:
|
|
- cd /builds/u5500327/wmgzon
|
|
- pip install -r requirements.txt
|
|
- pytest
|
|
|
|
deploy:
|
|
stage: deploy
|
|
tags:
|
|
- docker
|
|
image: docker:latest
|
|
services:
|
|
- name: docker:dind
|
|
alias: docker
|
|
script:
|
|
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
|
- docker buildx build --platform linux/amd64 -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA .
|
|
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
|
|
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA $CI_REGISTRY_IMAGE:latest
|
|
- docker push $CI_REGISTRY_IMAGE:latest
|
|
only:
|
|
- master |