sforkowany z mtyton/comfy
refactor CI pipeline
rodzic
ab7ec915aa
commit
7406a61636
|
@ -0,0 +1,13 @@
|
||||||
|
when:
|
||||||
|
event: tag
|
||||||
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
build:
|
||||||
|
image: docker:cli
|
||||||
|
secrets: [comfy_image]
|
||||||
|
commands:
|
||||||
|
- docker build ./artel -t $${COMFY_IMAGE} -f ./artel/Dockerfile
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
|
|
@ -3,7 +3,7 @@ when:
|
||||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
build-push:
|
push:
|
||||||
image: woodpeckerci/plugin-docker-buildx
|
image: woodpeckerci/plugin-docker-buildx
|
||||||
secrets: [docker_username, docker_password]
|
secrets: [docker_username, docker_password]
|
||||||
settings:
|
settings:
|
||||||
|
@ -14,3 +14,6 @@ steps:
|
||||||
tags:
|
tags:
|
||||||
- ${CI_COMMIT_TAG}
|
- ${CI_COMMIT_TAG}
|
||||||
- latest
|
- latest
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- test
|
|
@ -0,0 +1,17 @@
|
||||||
|
when:
|
||||||
|
event: tag
|
||||||
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
test:
|
||||||
|
image: docker:cli
|
||||||
|
commands:
|
||||||
|
- docker compose -f ./artel/docker-compose-test.yml run test_comfy
|
||||||
|
- docker compose -f ./artel/docker-compose-test.yml down
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
secrets: [uid, gid, database_url, postgres_root_password, postgres_user, postgres_password, postgres_db, django_settings_module, comfy_image]
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- build
|
||||||
|
|
|
@ -8,23 +8,24 @@ services:
|
||||||
- POSTGRES_USER
|
- POSTGRES_USER
|
||||||
- POSTGRES_PASSWORD
|
- POSTGRES_PASSWORD
|
||||||
- POSTGRES_DB
|
- POSTGRES_DB
|
||||||
volumes:
|
healthcheck:
|
||||||
- ../postgres/:/var/lib/postgresql
|
test: ["CMD-SHELL", "pg_isready"]
|
||||||
env_file:
|
interval: 10s
|
||||||
- .env
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
test_comfy:
|
test_comfy:
|
||||||
|
image: ${COMFY_IMAGE}
|
||||||
depends_on:
|
depends_on:
|
||||||
- test_db
|
test_db:
|
||||||
build:
|
condition: service_healthy
|
||||||
dockerfile: Dockerfile.local
|
|
||||||
context: ./
|
|
||||||
user: "${UID}:${GID}"
|
user: "${UID}:${GID}"
|
||||||
volumes:
|
|
||||||
- ./:/app
|
|
||||||
environment:
|
environment:
|
||||||
|
- UID
|
||||||
|
- GID
|
||||||
- SECRET_KEY
|
- SECRET_KEY
|
||||||
- DATABASE_URL
|
- DATABASE_URL
|
||||||
env_file:
|
- DJANGO_SETTINGS_MODULE
|
||||||
- .env
|
|
||||||
command:
|
command:
|
||||||
python manage.py test --noinput
|
python manage.py test --noinput
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue