Last active
October 1, 2018 22:06
-
-
Save byjml/9bf4c6b4a4c612d6421c to your computer and use it in GitHub Desktop.
My semi-automatic deployment script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Repository | |
REPOSITORY="username/project.git" | |
# GIT CLONE DIRECTORY | |
DIRECTORY="myproject" | |
# Path to project parent dir | |
PROJECT_PATH="path/to/project" | |
# Project directory | |
PROJECT_DIR="path/to/project/directory" | |
# START CLONING | |
echo -e "\033[32mPreparing the project \033[0m" | |
git clone [email protected]:"$REPOSITORY" "$DIRECTORY" | |
cd "$DIRECTORY" | |
npm install && \ | |
bower install && \ | |
gulp deploy | |
cd "../" | |
if [ -d "$PROJECT_DIR" ]; then | |
rm -rf "$PROJECT_DIR" | |
fi | |
echo -e "\033[32mMoving project files \033[0m" | |
mv "$DIRECTORY" "$PROJECT_PATH" | |
cd "$PROJECT_DIR" | |
echo -e "\033[32mDeleting temporary files \033[0m" | |
rm -rf node_modules && \ | |
rm -rf .git && \ | |
rm -r vendor && \ | |
rm -r resources && \ | |
rm .bowerrc && \ | |
rm .jshintrc && \ | |
rm .gitignore && \ | |
rm .gitattributes && \ | |
rm gulpfile.js && \ | |
rm bower.json | |
cd | |
echo "" | |
cat << "EOF" | |
______ | |
_\ _~-\___ | |
= = ==(____AA____O | |
\_____\___________________,-~~~~~~~`-.._ | |
/ o O o o o o O O o o o o o o O o |\_ | |
`~-.__ ___..----.. ) | |
`---~~\___________/------------````` | |
= ===(_________O | |
F I N I S H E D | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment