Compare commits

6 Commits

Author SHA1 Message Date
043e9fbfac update file 3
Some checks failed
continuous-integration/drone/tag Build is failing
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-07-10 15:43:51 +08:00
c22fac8b81 update file 2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-07-10 13:13:50 +08:00
97663dc942 update file
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-07-10 12:55:25 +08:00
5b6090e88d update file
Some checks failed
continuous-integration/drone/push Build is failing
2023-07-10 12:54:22 +08:00
e86cd394c5 feat: fix drone config 16
Some checks reported errors
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build encountered an error
2023-07-09 06:37:46 +08:00
56f86e0df0 feat: fix drone config 15
Some checks reported errors
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build encountered an error
2023-07-09 06:31:59 +08:00
6 changed files with 53 additions and 34 deletions

View File

@@ -13,6 +13,10 @@ trigger:
branch: branch:
include: include:
- feature/* - feature/*
event:
include:
- push
- custom
clone: clone:
disable: true disable: true
@@ -36,11 +40,6 @@ steps:
- docker-compose down - docker-compose down
- docker-compose up -d --build --force-recreate - docker-compose up -d --build --force-recreate
- docker image prune -f - docker image prune -f
when:
event:
include:
- push
- custom
--- ---
@@ -56,6 +55,9 @@ trigger:
branch: branch:
include: include:
- develop - develop
event:
include:
- push
clone: clone:
disable: true disable: true
@@ -79,10 +81,6 @@ steps:
- docker-compose down - docker-compose down
- docker-compose up -d --build --force-recreate - docker-compose up -d --build --force-recreate
- docker image prune -f - docker image prune -f
when:
event:
include:
- push
--- ---
@@ -99,6 +97,13 @@ trigger:
branch: branch:
include: include:
- main - main
event:
- pull_request
action:
include:
- opened
- reopened
- synchronized
clone: clone:
disable: true disable: true
@@ -122,41 +127,47 @@ steps:
- docker-compose down - docker-compose down
- docker-compose up -d --build --force-recreate - docker-compose up -d --build --force-recreate
- docker image prune -f - docker image prune -f
when:
event:
- pull_request
action:
include:
- opened
- reopened
- synchronized
--- ---
kind: pipeline kind: pipeline
type: docker type: docker
name: main-merge-pull-request-prod name: main-tag-prod
platform: platform:
os: linux os: linux
arch: amd64 arch: amd64
trigger: trigger:
branch:
include:
- main
event: event:
include: include:
- push - tag
clone: clone:
disable: true disable: true
steps: steps:
- name: semantic-release - name: clone-repo
image: gtramontina/semantic-release:17.4.3 image: alpine/git
environment: commands:
GITHUB_TOKEN: - git clone ${DRONE_GIT_HTTP_URL} .
from_secret: gitea_token - git checkout ${DRONE_BRANCH}
entrypoint: - name: build-and-push-image
- semantic-release image: plugins/docker
settings:
registry:
from_secret: docker_registry
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: gitea.bearcatlog.com/bryant/todo
context: .
dockerfile: ./Dockerfile
tags:
- ${DRONE_TAG}
purge: true
compress: true
# TODO 通知 k8s 更新镜像

View File

@@ -1,5 +1,9 @@
FROM python:3.11 FROM python:3.11
#WORKDIR /app WORKDIR /app
# CMD ["python3", "test.py"] COPY requirements.txt .
RUN python3 -m pip install -i https://mirrors.cloud.tencent.com/pypi/simple --trusted-host=mirrors.cloud.tencent.com -r requirements.txt
CMD ["python3", "app.py"]

4
app.py Normal file
View File

@@ -0,0 +1,4 @@
from apiflask import APIFlask
app = APIFlask(__name__)
app.run()

View File

@@ -12,10 +12,10 @@ services:
environment: environment:
TZ: "Asia/Shanghai" TZ: "Asia/Shanghai"
tty: true tty: true
working_dir: /app
command: ["python3", "test.py"]
networks: networks:
- todo-service - todo-service
ports:
- "5010:5000"
networks: networks:
todo-service: todo-service:

1
requirements.txt Normal file
View File

@@ -0,0 +1 @@
apiflask>=1.3.1

View File

@@ -1 +0,0 @@
print('hello drone')