From 78817bcd43af510db283bebd0046758bfca88d84 Mon Sep 17 00:00:00 2001 From: Gianmarco Pettinato Date: Sat, 27 May 2023 17:16:14 +0200 Subject: [PATCH] [ci]: develop ci --- .drone.yml | 61 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 20 deletions(-) diff --git a/.drone.yml b/.drone.yml index 06b1342..da5cc6d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,29 +1,50 @@ --- kind: pipeline type: docker -name: deploy +name: deploy-production steps: -- name: build-site - image: node:latest - commands: - - npm install - - npm run build + - name: build-site + image: node:latest + commands: + - npm install + - npm run build -- name: deploy - image: mwienk/docker-lftp - environment: - USERNAME: pettinattk - PASSWORD: - from_secret: password - HOST: ftp.cluster027.hosting.ovh.net - commands: - - "ls" - - echo $USERNAME - - echo $HOST - - echo $PASSWORD - - lftp -c "open -u $USERNAME,$PASSWORD $HOST; mirror -Rnev ./build ./www --ignore-time --parallel=10 --exclude .htaccess --exclude-glob .git* --exclude .git/" + - name: deploy + image: mwienk/docker-lftp + environment: + USERNAME: pettinattk + PASSWORD: + from_secret: password + HOST: ftp.cluster027.hosting.ovh.net + commands: + - lftp -c "open -u $USERNAME,$PASSWORD $HOST; mirror -Rnev ./build ./www --ignore-time --parallel=10 --exclude .htaccess --exclude-glob .git* --exclude .git/" trigger: branch: - - main \ No newline at end of file + - main +--- +kind: pipeline +type: docker +name: deploy-develop + +steps: + - name: build-site + image: node:latest + commands: + - npm install + - npm run build + + - name: deploy + image: mwienk/docker-lftp + environment: + SSH_KEY: + from_secret: ssh_key + commands: + - mkdir -p /root/.ssh/ && echo $SSH_KEY > /root/.ssh/id_droneci && chmod 0600 /root/.ssh/id_droneci && ssh-keyscan -p 69 -H 192.168.178.25 >> /root/.ssh/known_hosts + - ssh -i /root/.ssh/id_droneci -p 69 root@192.168.178.25 "mv /mnt/user/appdata/binhex-nginx/nginx/html /mnt/user/appdata/binhex-nginx/nginx/html$(date -I) && mkdir /mnt/user/appdata/binhex-nginx/nginx/html" + - scp -r -i /root/.ssh/id_droneci -p 69 ./build/* root@192.168.178.25/mnt/user/appdata/binhex-nginx/nginx/html/ + +trigger: + branch: + - develop