mirror of
https://github.com/lemeow125/DRF_Template.git
synced 2025-09-18 05:29:37 +08:00
Move to uv/pyproject and overhaul project structure
This commit is contained in:
commit
fbb76f8196
26 changed files with 1981 additions and 0 deletions
39
.woodpecker/.build.yml
Normal file
39
.woodpecker/.build.yml
Normal file
|
@ -0,0 +1,39 @@
|
|||
labels:
|
||||
platform: linux/amd64
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: docker
|
||||
environment:
|
||||
FORGEJO_REGISTRY_URL:
|
||||
from_secret: FORGEJO_REGISTRY_URL
|
||||
FORGEJO_REGISTRY_USERNAME:
|
||||
from_secret: FORGEJO_REGISTRY_USERNAME
|
||||
FORGEJO_REGISTRY_PASSWORD:
|
||||
from_secret: FORGEJO_REGISTRY_PASSWORD
|
||||
REGISTRY_IMAGE_TAG:
|
||||
from_secret: REGISTRY_IMAGE_TAG
|
||||
commands:
|
||||
- docker build -t "$REGISTRY_IMAGE_TAG" .
|
||||
- echo "$FORGEJO_REGISTRY_PASSWORD" | docker login "$FORGEJO_REGISTRY_URL" --password-stdin -u "$FORGEJO_REGISTRY_USERNAME"
|
||||
- docker push "$REGISTRY_IMAGE_TAG"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- name: discord
|
||||
image: appleboy/drone-discord
|
||||
settings:
|
||||
webhook_id:
|
||||
from_secret: DISCORD_WEBHOOK_ID
|
||||
webhook_token:
|
||||
from_secret: DISCORD_WEBHOOK_TOKEN
|
||||
message: >
|
||||
{{#success build.status}}
|
||||
{{repo.name}} build #{{build.number}} {{build.status}}
|
||||
{{/success}}
|
||||
depends_on: build
|
||||
|
||||
when:
|
||||
- branch: master
|
||||
event:
|
||||
- push
|
||||
- manual
|
49
.woodpecker/.deploy.yml
Normal file
49
.woodpecker/.deploy.yml
Normal file
|
@ -0,0 +1,49 @@
|
|||
steps:
|
||||
- name: deploy
|
||||
image: alpine:3.20
|
||||
environment:
|
||||
SSH_HOST:
|
||||
from_secret: SSH_HOST
|
||||
PROJECT_DIRECTORY:
|
||||
from_secret: PROJECT_DIRECTORY
|
||||
SSH_KEY:
|
||||
from_secret: SSH_KEY
|
||||
REGISTRY_IMAGE_TAG:
|
||||
from_secret: REGISTRY_IMAGE_TAG
|
||||
DOCKER_VOLUME_DB:
|
||||
from_secret: DOCKER_VOLUME_DB
|
||||
commands:
|
||||
- apk add openssh
|
||||
- mkdir -p /root/.ssh/
|
||||
- echo "$SSH_KEY" | tr -d '\r' > /root/.ssh/id_rsa
|
||||
- chmod 600 /root/.ssh/id_rsa
|
||||
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config
|
||||
- ssh "$SSH_HOST" "
|
||||
cd "$PROJECT_DIRECTORY";
|
||||
docker-compose down;
|
||||
docker image rm "$REGISTRY_IMAGE_TAG" || true;
|
||||
docker volume rm "$DOCKER_VOLUME_DB" || true;
|
||||
docker pull "$REGISTRY_IMAGE_TAG";
|
||||
docker-compose up -d;
|
||||
docker image prune -af;"
|
||||
- name: discord
|
||||
image: appleboy/drone-discord
|
||||
settings:
|
||||
webhook_id:
|
||||
from_secret: DISCORD_WEBHOOK_ID
|
||||
webhook_token:
|
||||
from_secret: DISCORD_WEBHOOK_TOKEN
|
||||
message: >
|
||||
{{#success build.status}}
|
||||
{{repo.name}} deployment #{{build.number}} {{build.status}}
|
||||
{{/success}}
|
||||
depends_on: deploy
|
||||
|
||||
when:
|
||||
- branch: master
|
||||
event:
|
||||
- push
|
||||
- manual
|
||||
|
||||
depends_on:
|
||||
- build
|
Loading…
Add table
Add a link
Reference in a new issue