Created
August 18, 2016 23:10
-
-
Save joseluisq/1ed40e8bcfe0aa0cfb4e832f786cbd88 to your computer and use it in GitHub Desktop.
Small Bitbucket shell script for deployment PHP composer project
This file contains 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
#!/bin/sh | |
# Small Bitbucket shell script for deployment PHP composer project | |
# @author José Luis Quintana <http://git.io/joseluisq> | |
# Note: It's necessary to add some hook in repository settings. | |
# Settings | |
REPLOY_REPO_NAME=repository-name | |
DEPLOY_PATH=/username/www/project/ | |
AUTH=username:pwd | |
TEAM_NAME=team-name | |
REPO_PATH=${TEAM_NAME}/${REPLOY_REPO_NAME} | |
# Deployment process | |
rm -rf ${DEPLOY_PATH}/* | |
git clone https://${AUTH}@bitbucket.org/${REPO_PATH}.git --depth=1 ${PATH} | |
rm -rf ${DEPLOY_PATH}/.git | |
# Install Composer dependencies | |
cd ${DEPLOY_PATH} | |
composer install --no-dev --optimize-autoloader --no-ansi --no-scripts | |
exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment