Parcourir la source

Update drone with deploy task

Colin Powell il y a 1 an
Parent
commit
c0dcdb6d5f
1 fichiers modifiés avec 20 ajouts et 3 suppressions
  1. 20 3
      .drone.yml

+ 20 - 3
.drone.yml

@@ -7,9 +7,8 @@ kind: pipeline
 name: run_tests
 
 steps:
-  # Run tests against Python/Flask engine backend (with pytest)
-  - name: django_tests
-    image: python:3.10.4
+  - name: pytest with coverage
+    image: python:3.11.1
     commands:
       # Install dependencies
       - cp emus.conf.example emus.conf
@@ -23,6 +22,24 @@ steps:
       # Mount pip cache from host
       - name: pip_cache
         path: /root/.cache/pip
+  - name: deploy
+    image: appleboy/drone-ssh
+    settings:
+      host:
+        - emus.service
+      username: root
+      ssh_key:
+        from_secret: ssh_key
+      command_timeout: 2m
+      script:
+        - pip uninstall -y emus_web
+        - pip install git+https://code.unbl.ink/secstate/emus.git@main
+        - emus_web migrate
+        - emus_web collectstatic --noinput
+        - immortalctl restart emus
+    when:
+      branch:
+      - main
 volumes:
   - name: docker
     host: