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}
|
||||
|
||||
steps:
|
||||
build-push:
|
||||
push:
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
secrets: [docker_username, docker_password]
|
||||
settings:
|
||||
|
@ -14,3 +14,6 @@ steps:
|
|||
tags:
|
||||
- ${CI_COMMIT_TAG}
|
||||
- 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_PASSWORD
|
||||
- POSTGRES_DB
|
||||
volumes:
|
||||
- ../postgres/:/var/lib/postgresql
|
||||
env_file:
|
||||
- .env
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
test_comfy:
|
||||
image: ${COMFY_IMAGE}
|
||||
depends_on:
|
||||
- test_db
|
||||
build:
|
||||
dockerfile: Dockerfile.local
|
||||
context: ./
|
||||
test_db:
|
||||
condition: service_healthy
|
||||
user: "${UID}:${GID}"
|
||||
volumes:
|
||||
- ./:/app
|
||||
environment:
|
||||
- UID
|
||||
- GID
|
||||
- SECRET_KEY
|
||||
- DATABASE_URL
|
||||
env_file:
|
||||
- .env
|
||||
- DJANGO_SETTINGS_MODULE
|
||||
command:
|
||||
python manage.py test --noinput
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue