Compare commits

..

No commits in common. "7e3fe006051e3437299f9fe63c8a3cd2048bb313" and "2e7766631f7cdd1017e80adf42acefc2d138b1eb" have entirely different histories.

3 changed files with 4 additions and 103 deletions

View File

@ -1,5 +1,6 @@
# drone 会自动先拉取代码
# 再按顺序执行 pipeline 配置中定义的任务
---
kind: pipeline
type: docker
@ -31,10 +32,9 @@ steps:
script:
- cd /var/www/todo
- git fetch
- git checkout ${DRONE_BRANCH}
- git reset --hard ${DRONE_COMMIT}
- docker-compose down
- docker-compose up -d --build --force-recreate
- docker-compose up -d --build
- docker image prune -f
when:
event:
@ -42,96 +42,5 @@ steps:
- push
- custom
---
kind: pipeline
type: docker
name: develop
platform:
os: linux
arch: amd64
trigger:
branch:
include:
- develop
clone:
disable: true
steps:
- name: deploy
image: appleboy/drone-ssh
settings:
host:
from_secret: host
username: root
key:
from_secret: ssh_key
port: 22
script_stop: true
script:
- cd /var/www/todo
- git fetch
- git checkout ${DRONE_BRANCH}
- git reset --hard ${DRONE_COMMIT}
- docker-compose down
- docker-compose up -d --build --force-recreate
- docker image prune -f
when:
event:
include:
- pull_request
action:
include:
- opened
- reopened
- synchronized
---
kind: pipeline
type: docker
name: main-pull-request-staging
platform:
os: linux
arch: amd64
trigger:
branch:
include:
- main
clone:
disable: true
steps:
- name: deploy
image: appleboy/drone-ssh
settings:
host:
from_secret: host
username: root
key:
from_secret: ssh_key
port: 22
script_stop: true
script:
- cd /var/www/todo
- git fetch
- git checkout ${DRONE_BRANCH}
- git reset --hard ${DRONE_COMMIT}
- docker-compose down
- docker-compose up -d --build --force-recreate
- docker image prune -f
when:
event:
- pull_request
action:
include:
- opened
- reopened
- synchronized

View File

@ -1,5 +1,5 @@
FROM python:3.11
#WORKDIR /app
WORKDIR /app
# CMD ["python3", "test.py"]
CMD ["python3", "test.py"]

View File

@ -12,12 +12,4 @@ services:
environment:
TZ: "Asia/Shanghai"
tty: true
working_dir: /app
command: ["python3", "test.py"]
networks:
- todo-service
networks:
todo-service:
driver: bridge