Skip to content
Snippets Groups Projects
.drone.yml 2.60 KiB
kind: pipeline
type: docker
name: deploy

clone:
  disable: true

steps:
- name: notif build start
  image: appleboy/drone-discord
  settings:
    webhook_id:
      from_secret: discord_webhook_id
    webhook_token:
      from_secret: discord_webhook_token
    username: "Drone Princelle (ERP: rms)"
    avatar_url: https://s3.princelle.org/share/drone-ci.png
    message: >
      🚀 Starting deployment of **{{ repo.name }}** repo (*ERP*)...

      
      **Commit from {{commit.author}} on {{commit.branch}}:** 
      
      {{commit.message}}

      {{ build.link }}


- name: pull
  image: appleboy/drone-ssh
  settings:
    host: flash.princelle.org
    username: mprincelle
    port: 22
    key:
      from_secret: ci_key
    script:
      - cd /app/uni/erp/rms
      - git fetch --all
      - git reset --hard origin/main
      - git pull

- name: configure
  image: appleboy/drone-ssh
  settings:
    host: flash.princelle.org
    username: mprincelle
    port: 22
    key:
      from_secret: ci_key
    script:
      - cd /app/uni/erp/rms
      - echo -e "REACT_APP_BACK_API_KEY=theapikey" > .env
      - echo -e "\nREACT_APP_BACK_URL=back.erp.uni.princelle.org" >> .env
      - echo -e "\nAPP_PORT=2002" >> .env

- name: build
  image: appleboy/drone-ssh
  settings:
    host: flash.princelle.org
    username: mprincelle
    port: 22
    key:
      from_secret: ci_key
    script:
      - cd /app/uni/erp/rms
      - docker-compose up -d --build


- name: notif deploy done