dda-devops-build/.gitlab-ci.yml

75 lines
1.4 KiB
YAML
Raw Normal View History

2023-07-14 11:11:49 +00:00
stages:
- lint&test
- upload
- image
2022-02-22 17:01:08 +00:00
2023-07-14 11:11:49 +00:00
.py: &py
image: "domaindrivenarchitecture/ddadevops-python:latest"
before_script:
- python --version
- pip install -r requirements.txt
2023-07-14 11:11:49 +00:00
.img: &img
image: "domaindrivenarchitecture/ddadevops-dind:latest"
services:
- docker:dind
before_script:
2023-05-20 11:47:33 +00:00
- export IMAGE_DOCKERHUB_USER=$DOCKERHUB_USER
2023-05-20 09:48:49 +00:00
- export IMAGE_DOCKERHUB_PASSWORD=$DOCKERHUB_PASSWORD
2023-07-14 11:11:49 +00:00
- export IMAGE_TAG=$CI_COMMIT_TAG
2023-07-14 11:11:49 +00:00
.tag_only: &tag_only
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: '$CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+$/'
2022-02-22 17:01:08 +00:00
2023-07-06 16:37:43 +00:00
lint:
2023-07-14 11:13:28 +00:00
<<: *py
2022-12-30 13:05:15 +00:00
stage: lint&test
2022-02-22 17:01:08 +00:00
script:
2023-07-12 12:45:09 +00:00
- pip install -r dev_requirements.txt
2023-07-06 16:37:43 +00:00
- pyb lint
2022-12-30 13:05:15 +00:00
pytest:
2023-07-14 11:13:28 +00:00
<<: *py
2022-12-30 13:05:15 +00:00
stage: lint&test
script:
- pip install -r dev_requirements.txt
2023-07-06 16:37:43 +00:00
- pyb test
2022-02-22 17:01:08 +00:00
pypi-stable:
2023-07-14 11:13:28 +00:00
<<: *py
2023-07-14 11:11:49 +00:00
<<: *tag_only
2022-02-22 17:01:08 +00:00
stage: upload
script:
2022-03-29 17:13:02 +00:00
- pyb -P version=$CI_COMMIT_TAG publish upload
2022-05-20 08:01:53 +00:00
2023-07-14 11:11:49 +00:00
clojure-image-publish:
<<: *img
<<: *tag_only
2022-05-20 08:01:53 +00:00
stage: image
script:
2023-07-14 11:11:49 +00:00
- cd infrastructure/clojure && pyb image publish
2022-05-20 08:01:53 +00:00
2023-07-14 11:11:49 +00:00
python-image-publish:
<<: *img
<<: *tag_only
stage: image
script:
- cd infrastructure/python && pyb image publish
dind-image-publish:
<<: *img
<<: *tag_only
stage: image
script:
- cd infrastructure/dind && pyb image publish
ddadevops-image-publish:
<<: *img
<<: *tag_only
2022-05-20 08:01:53 +00:00
stage: image
script:
2023-07-14 11:11:49 +00:00
- cd infrastructure/ddadevops && pyb image publish