Compare commits
6 Commits
cfb22f64b5
...
v0.1.0
Author | SHA1 | Date | |
---|---|---|---|
043e9fbfac | |||
c22fac8b81 | |||
97663dc942 | |||
5b6090e88d | |||
e86cd394c5 | |||
56f86e0df0 |
69
.drone.yml
69
.drone.yml
@@ -13,6 +13,10 @@ trigger:
|
||||
branch:
|
||||
include:
|
||||
- feature/*
|
||||
event:
|
||||
include:
|
||||
- push
|
||||
- custom
|
||||
|
||||
clone:
|
||||
disable: true
|
||||
@@ -36,11 +40,6 @@ steps:
|
||||
- docker-compose down
|
||||
- docker-compose up -d --build --force-recreate
|
||||
- docker image prune -f
|
||||
when:
|
||||
event:
|
||||
include:
|
||||
- push
|
||||
- custom
|
||||
|
||||
---
|
||||
|
||||
@@ -56,6 +55,9 @@ trigger:
|
||||
branch:
|
||||
include:
|
||||
- develop
|
||||
event:
|
||||
include:
|
||||
- push
|
||||
|
||||
clone:
|
||||
disable: true
|
||||
@@ -79,10 +81,6 @@ steps:
|
||||
- docker-compose down
|
||||
- docker-compose up -d --build --force-recreate
|
||||
- docker image prune -f
|
||||
when:
|
||||
event:
|
||||
include:
|
||||
- push
|
||||
|
||||
|
||||
---
|
||||
@@ -99,6 +97,13 @@ trigger:
|
||||
branch:
|
||||
include:
|
||||
- main
|
||||
event:
|
||||
- pull_request
|
||||
action:
|
||||
include:
|
||||
- opened
|
||||
- reopened
|
||||
- synchronized
|
||||
|
||||
clone:
|
||||
disable: true
|
||||
@@ -122,41 +127,47 @@ steps:
|
||||
- docker-compose down
|
||||
- docker-compose up -d --build --force-recreate
|
||||
- docker image prune -f
|
||||
when:
|
||||
event:
|
||||
- pull_request
|
||||
action:
|
||||
include:
|
||||
- opened
|
||||
- reopened
|
||||
- synchronized
|
||||
|
||||
---
|
||||
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: main-merge-pull-request-prod
|
||||
name: main-tag-prod
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
include:
|
||||
- main
|
||||
event:
|
||||
include:
|
||||
- push
|
||||
- tag
|
||||
|
||||
clone:
|
||||
disable: true
|
||||
|
||||
steps:
|
||||
- name: semantic-release
|
||||
image: gtramontina/semantic-release:17.4.3
|
||||
environment:
|
||||
GITHUB_TOKEN:
|
||||
from_secret: gitea_token
|
||||
entrypoint:
|
||||
- semantic-release
|
||||
- name: clone-repo
|
||||
image: alpine/git
|
||||
commands:
|
||||
- git clone ${DRONE_GIT_HTTP_URL} .
|
||||
- git checkout ${DRONE_BRANCH}
|
||||
- name: build-and-push-image
|
||||
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 更新镜像
|
@@ -1,5 +1,9 @@
|
||||
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
4
app.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from apiflask import APIFlask
|
||||
|
||||
app = APIFlask(__name__)
|
||||
app.run()
|
@@ -12,10 +12,10 @@ services:
|
||||
environment:
|
||||
TZ: "Asia/Shanghai"
|
||||
tty: true
|
||||
working_dir: /app
|
||||
command: ["python3", "test.py"]
|
||||
networks:
|
||||
- todo-service
|
||||
ports:
|
||||
- "5010:5000"
|
||||
|
||||
networks:
|
||||
todo-service:
|
||||
|
1
requirements.txt
Normal file
1
requirements.txt
Normal file
@@ -0,0 +1 @@
|
||||
apiflask>=1.3.1
|
Reference in New Issue
Block a user