diff --git a/.woodpecker/pipeline.yml b/.woodpecker/pipeline.yml index 4e5db94..8cea7ba 100644 --- a/.woodpecker/pipeline.yml +++ b/.woodpecker/pipeline.yml @@ -6,29 +6,8 @@ pipeline: when: event: push - generate_docker_tag_pr: - image: golang - commands: - - echo -n "pr-${CI_COMMIT_SHA:0:8}, pr" > .tags - when: - event: pull_request # -------------------------------------- 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: image: woodpeckerci/plugin-docker-buildx settings: @@ -46,22 +25,6 @@ pipeline: path: "api/*" 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 -------------------------------------- build_bot: @@ -79,21 +42,7 @@ pipeline: platforms: linux/amd64 when: path: "telegram_bot/*" - - 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/*" + event: push # -------------------------------------- Frontend -------------------------------------- @@ -112,8 +61,11 @@ pipeline: platforms: linux/amd64 when: path: "frontend/*" - - deploy_frontend: + event: push + + + # -------------------------------------- Deploy -------------------------------------- + deploy: image: appleboy/drone-ssh network_mode: host settings: @@ -124,8 +76,10 @@ pipeline: password: from_secret: ssh_password script: - - /opt/docker/TelegramAktienBot/deploy_frontend.sh - when: - path: "frontend/*" + - cd /root/docker/aktienbot + - docker-compose up -p "aktienbot" --force-recreate --build -d + - docker image prune -f + when: + event: push branches: main