Compare commits
2 Commits
53d6aba5db
...
da66f4c19f
Author | SHA1 | Date | |
---|---|---|---|
da66f4c19f | |||
a42c9abb62 |
30
deploy.sh
30
deploy.sh
@@ -1,20 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
REPO=https://git.xo.nl/marcel/deploy/raw/branch/master
|
||||
CODE=https://git.xo.nl/marcel/deploy/raw/branch/master
|
||||
SECRET=https://git.xo.nl/marcel/secret/raw/branch/master
|
||||
GREEN='\033[0;32m'
|
||||
RED='\033[0;31m'
|
||||
NOCOL='\033[0m'
|
||||
|
||||
Fail() {
|
||||
echo -e "${RED}no package was selected, exitting${NOCOL}"
|
||||
echo -e "${RED}command not entered, exitting${NOCOL}"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Exec() {
|
||||
echo -e "${GREEN}Starting installation of $1${NOCOL}"
|
||||
sleep 2
|
||||
bash -c "$(curl -fsSL $REPO/$1/install.sh)"
|
||||
exit 0
|
||||
case $1 in
|
||||
install)
|
||||
echo -e "${GREEN}Starting installation of $1${NOCOL}"
|
||||
sleep 2
|
||||
bash -c "$(curl -fsSL $REPO/$1/install.sh)"
|
||||
exit 0;;
|
||||
setup)
|
||||
echo -n "Git username: "
|
||||
read USER
|
||||
echo -n "Git password: "
|
||||
read -s PASS
|
||||
echo -e "${GREEN}Starting setup of $1${NOCOL}"
|
||||
sleep 2
|
||||
curl -u $USER:$PASS -so /tmp/$1.tmp $SECRET/$1/setup.env
|
||||
bash -c "$(curl -fsSL $REPO/$1/setup.sh)"
|
||||
rm -f /tmp/$1.tmp
|
||||
exit 0;;
|
||||
*)
|
||||
echo -r "${RED}application name not entered, exitting${NOCOL}"
|
||||
exit 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
if [[ -z $1 ]]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
source /root/setup.env
|
||||
source /tmp/kopia.env
|
||||
|
||||
kopia repository create webdav --url $BACKUP_STORAGE/$HOSTNAME --webdav-username=$BACKUP_USER --webdav-password=$BACKUP_PASS
|
||||
kopia policy set --keep-daily=$BACKUP_DAILY --keep-latest=$BACKUP_LATEST --keep-hourly=$BACKUP_HOURLY --keep-weekly=$BACKUP_WEEKLY --keep-monthly=$BACKUP_MONTHLY --keep-annual=$KEEP_ANNUAL --global
|
||||
|
Reference in New Issue
Block a user