Update pipeline

This commit is contained in:
Administrator 2022-04-04 15:35:16 +02:00
parent 6fd3f05ba2
commit 51c598d506

View File

@ -6,29 +6,8 @@ pipeline:
when: when:
event: push event: push
generate_docker_tag_pr:
image: golang
commands:
- echo -n "pr-${CI_COMMIT_SHA:0:8}, pr" > .tags
when:
event: pull_request
# -------------------------------------- API -------------------------------------- # -------------------------------------- API --------------------------------------
# test_api:
# image: python
# detach: true
# commands:
# - export MYSQL_USER=aktienbot
# - export MYSQL_PASSWORD=12345678
# - export MYSQL_HOST=mariadb
# - export MYSQL_PORT=3306
# - cd api/
# - pip install -r requirements.txt
# - python -m pytest
# when:
# path: "api/*"
# event: push
build_api: build_api:
image: woodpeckerci/plugin-docker-buildx image: woodpeckerci/plugin-docker-buildx
settings: settings:
@ -46,22 +25,6 @@ pipeline:
path: "api/*" path: "api/*"
event: push event: push
deploy_api:
image: appleboy/drone-ssh
network_mode: host
settings:
host:
from_secret: ssh_host
username:
from_secret: ssh_user
password:
from_secret: ssh_password
script:
- /opt/docker/TelegramAktienBot/deploy_api.sh
when:
path: "api/*"
event: push
# -------------------------------------- Bot -------------------------------------- # -------------------------------------- Bot --------------------------------------
build_bot: build_bot:
@ -79,21 +42,7 @@ pipeline:
platforms: linux/amd64 platforms: linux/amd64
when: when:
path: "telegram_bot/*" path: "telegram_bot/*"
event: push
deploy_bot:
image: appleboy/drone-ssh
network_mode: host
settings:
host:
from_secret: ssh_host
username:
from_secret: ssh_user
password:
from_secret: ssh_password
script:
- /opt/docker/TelegramAktienBot/deploy_bot.sh
when:
path: "telegram_bot/*"
# -------------------------------------- Frontend -------------------------------------- # -------------------------------------- Frontend --------------------------------------
@ -112,8 +61,11 @@ pipeline:
platforms: linux/amd64 platforms: linux/amd64
when: when:
path: "frontend/*" path: "frontend/*"
event: push
deploy_frontend:
# -------------------------------------- Deploy --------------------------------------
deploy:
image: appleboy/drone-ssh image: appleboy/drone-ssh
network_mode: host network_mode: host
settings: settings:
@ -124,8 +76,10 @@ pipeline:
password: password:
from_secret: ssh_password from_secret: ssh_password
script: script:
- /opt/docker/TelegramAktienBot/deploy_frontend.sh - cd /root/docker/aktienbot
- docker-compose up -p "aktienbot" --force-recreate --build -d
- docker image prune -f
when: when:
path: "frontend/*" event: push
branches: main branches: main