1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
theorangeone.net-legacy/scripts/deploy.sh

30 lines
729 B
Bash
Raw Normal View History

2016-01-05 08:53:49 +00:00
#!/usr/bin/env bash
set -e
RED='tput setaf 1'
NC='tput sgr 0'
YELLOW='tput setaf 3'
GREEN='tput setaf 2'
cd
echo "$($YELLOW)>> Fetching Repository...$($NC)"
ctf fetch RealOrangeOne/theorangeone.net master deployment
sleep 15
echo "$($YELLOW)>> Entering Project...$($NC)"
project_dir="$(\ls -1dt ./*/ | head -n 1)"
previous_dir = "$(\ls -1dt ./*/ | head -n 2)"
cd project_dira
echo "$($YELLOW)>> Building Project...$($NC)"
ctf project run build
ctf project run manage.py migrate
echo "$($YELLOW)>> Routing Project...$($NC)"
ident=$project_dir + ":development:web"
ctf router theorangeone.net --ident %ident
echo "$($YELLOW)>> Destroying Previous Project...$($NC)"
cd -
cd previous_dir
ctf project stop
cd -
rm -rf previous_dir