Compare commits

..

15 Commits

Author SHA1 Message Date
BryantHe 7e3fe00605 fix drone config 12
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
2023-07-09 05:50:21 +08:00
BryantHe b5ecdc9eef fix drone config 11
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2023-07-09 05:46:44 +08:00
BryantHe da5b84e5c9 fix drone config 10
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2023-07-09 05:43:57 +08:00
BryantHe 8ea68aabfe fix drone config 9
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2023-07-09 05:41:43 +08:00
BryantHe ce40570c93 fix drone config 8
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is passing Details
2023-07-09 05:39:11 +08:00
BryantHe 97e61f1007 fix drone config 7
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is passing Details
2023-07-09 05:37:54 +08:00
BryantHe 07749c709e fix drone config 6
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is failing Details
2023-07-09 05:33:52 +08:00
BryantHe 6fa57028dd fix drone config 5
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-07-09 05:26:52 +08:00
BryantHe 530d52fddd fix drone config 4
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2023-07-09 05:12:10 +08:00
BryantHe acf13bb6b8 fix drone config 3
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is passing Details
2023-07-09 05:08:35 +08:00
BryantHe 8e0d7d13de fix drone config 2
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is failing Details
2023-07-09 05:01:53 +08:00
BryantHe e198e15699 fix drone config
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-07-09 04:52:38 +08:00
BryantHe 86eaff16b0 fix drone config
continuous-integration/drone/push Build is passing Details
2023-07-09 02:43:14 +08:00
BryantHe 664d7aa60d fix drone config
continuous-integration/drone/push Build is passing Details
2023-07-09 02:37:05 +08:00
BryantHe 186d639ce2 fix drone config
continuous-integration/drone/push Build is passing Details
2023-07-09 02:34:26 +08:00
3 changed files with 103 additions and 4 deletions

View File

@ -1,6 +1,5 @@
# drone 会自动先拉取代码 # drone 会自动先拉取代码
# 再按顺序执行 pipeline 配置中定义的任务 # 再按顺序执行 pipeline 配置中定义的任务
---
kind: pipeline kind: pipeline
type: docker type: docker
@ -32,9 +31,10 @@ steps:
script: script:
- cd /var/www/todo - cd /var/www/todo
- git fetch - git fetch
- git checkout ${DRONE_BRANCH}
- git reset --hard ${DRONE_COMMIT} - git reset --hard ${DRONE_COMMIT}
- docker-compose down - docker-compose down
- docker-compose up -d --build - docker-compose up -d --build --force-recreate
- docker image prune -f - docker image prune -f
when: when:
event: event:
@ -42,5 +42,96 @@ steps:
- push - push
- custom - 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 FROM python:3.11
WORKDIR /app #WORKDIR /app
CMD ["python3", "test.py"] # CMD ["python3", "test.py"]

View File

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