A
This commit is contained in:
29
.drone.yml
29
.drone.yml
@@ -4,41 +4,58 @@ name: default
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: python:3.11-slim
|
||||
commands:
|
||||
- pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
- name: test
|
||||
image: python:3.11-slim
|
||||
commands:
|
||||
- pip install --no-cache-dir -r requirements.txt
|
||||
- pip install pytest pytest-asyncio
|
||||
- pytest tests/ -v || true
|
||||
|
||||
- name: docker-build
|
||||
image: plugins/docker
|
||||
settings:
|
||||
repo: gitea.allowlgroup.ru/allowlgroup/gptchat
|
||||
registry: https://gitea.allowlgroup.ru
|
||||
insecure: true
|
||||
tags:
|
||||
- latest
|
||||
- ${DRONE_COMMIT_SHA:0:8}
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
registry: gitea.allowlgroup.ru
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
when:
|
||||
branch:
|
||||
- main
|
||||
event:
|
||||
- push
|
||||
|
||||
- custom
|
||||
|
||||
- name: deploy
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host: 45.129.78.228
|
||||
host: 127.0.0.1
|
||||
username:
|
||||
from_secret: ssh_username
|
||||
password:
|
||||
from_secret: ssh_password
|
||||
port: 22
|
||||
script:
|
||||
- export DOCKER_HOST="unix:///var/run/docker.sock"
|
||||
- docker stop gptchat || true
|
||||
- docker rm gptchat || true
|
||||
- docker pull gitea.allowlgroup.ru/allowlgroup/gptchat:latest
|
||||
- docker run -d --name gptchat -p 8484:8484 --restart unless-stopped gitea.allowlgroup.ru/allowlgroup/gptchat:latest
|
||||
depends_on:
|
||||
- build
|
||||
- docker run -d --name gptchat -p 8484:8484 gitea.allowlgroup.ru/allowlgroup/gptchat:latest
|
||||
when:
|
||||
branch:
|
||||
- main
|
||||
event:
|
||||
- push
|
||||
- custom
|
||||
|
||||
|
||||
Reference in New Issue
Block a user