parent
0b804fc7fb
commit
7c8e46d70b
@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#use the right command to install packages
|
||||
if [ "$(command -v apt)" ]; then CMD=apt; else CMD=yum; fi
|
||||
|
||||
echo "installing packages..."
|
||||
eval $CMD update > /dev/null
|
||||
eval $CMD -y install openssh-client > /dev/null
|
||||
echo "done."
|
||||
|
||||
echo "$SSH_PRIVATE_KEY" > /root/.ssh/id_rsa
|
||||
echo "$SSH_PUBLIC_KEY" > /root/.ssh/id_rsa.pub
|
||||
chmod 0600 /root/.ssh/*
|
||||
chmod 700 /root/.ssh
|
||||
|
||||
case "$1" in
|
||||
"dev")
|
||||
export USER=maxime
|
||||
export IP=92.132.18.192
|
||||
export DIR=server/TBasket/backend
|
||||
;;
|
||||
"production")
|
||||
export USER=palafour
|
||||
export IP=193.49.118.205
|
||||
export DIR=TBasket/backend
|
||||
;;
|
||||
"")
|
||||
echo "first argument 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
|
Reference in new issue