#!/usr/bin/env bash mkdir /root/.ssh echo "$SSH_PRIVATE_KEY" > /root/.ssh/id_rsa chmod 0600 /root/.ssh/* chmod 700 /root/.ssh chmod 700 /root case "$DRONE_BRANCH" in "dev") USER=tbasket-dev IP=92.132.18.192 DIR=/server/TBasket ;; "production") USER=mabatista1 IP=lisbonne.iut-clermont.uca.fr DIR=tbasket ;; "") echo '$DRONE_BRANCH is missing' >&2 exit 1 ;; *) echo "branch $1 is unable to perform delivery, authorized branches are 'dev and production' for delivery." >&2 echo "delivery step skipped" exit 0 esac