-
Notifications
You must be signed in to change notification settings - Fork 0
HowtodeployPerfume
Ivan Beschastnikh edited this page May 27, 2020
·
4 revisions
The following shell script clones the perfume-frontend repository, builds necessary pages, deploys to a specified directory, and removes development files from the deployment.
Shell script contents:
#!/bin/bash
# Default deployment location
wwwlocation=/var/www/html/perfume/
# Set deployment if specified
if [ "$1" != "" ]; then
wwwlocation=$1
fi
echo ===== DEPLOYING PERFUME TO $wwwlocation =====
# Clone perfume frontend repository
echo ===== CLONING REPOSITORY =====
hg clone https://bitbucket.org/bestchai/perfume-frontend
# Build frontend pages
echo ===== BUILDING FRONTEND PAGES =====
cd perfume-frontend/
python Makefile.py
# Copy all files to actual www directory
echo ===== DEPLOYING =====
cd ..
mkdir -p $wwwlocation
cp -R perfume-frontend/* $wwwlocation
# Prune files not needed by a deployment
echo ===== PRUNING DEV FILES FROM DEPLOYMENT =====
cd $wwwlocation
rm -rf Makefile.py README.md deploy_perfume.* template/
Put the above "shell script contents" into a file called deploy_perfume_frontend.sh, then in a terminal, make it executable, and run it:
chmod +x deploy_perfume_frontend.sh
./deploy_perfume_frontend.sh
And you're all done!