Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save allanfreitas/fe49dcc2d4a42d86c99112e617024733 to your computer and use it in GitHub Desktop.
Save allanfreitas/fe49dcc2d4a42d86c99112e617024733 to your computer and use it in GitHub Desktop.
Small Bitbucket shell script for deployment PHP composer project
#!/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