Skip to content

Commit cbc3a3d

Browse files
committed
Only deploy master branch
1 parent 3cb2dbc commit cbc3a3d

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

buildspec-4-sftpdeploy.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,26 +79,26 @@ phases:
7979

8080
# Deployment to the SFTP server
8181
- |
82-
# Determine what git branch we're on, we only want to deploy master
83-
export CODEBUILD_GIT_BRANCH=`git symbolic-ref HEAD --short 2>/dev/null`
84-
if [[ "$CODEBUILD_GIT_BRANCH" == 'master' ]]; then
85-
exit 0
82+
# Determine what git branch we're on, we only want to deploy master
83+
export CODEBUILD_GIT_BRANCH=`git symbolic-ref HEAD --short 2>/dev/null`
84+
if [[ "$CODEBUILD_GIT_BRANCH" == 'master' ]]; then
85+
exit 0
8686
fi
8787
88-
# Install SSH client so we can deploy
89-
apt-get install -y openssh-client
88+
# Install SSH client so we can deploy
89+
apt-get install -y openssh-client
9090
91-
# Setup the SSH key
92-
mkdir ~/.ssh
93-
chmod 700 ~/.ssh
94-
echo $SSH_KEY | base64 -d > ~/.ssh/id_rsa
95-
chmod 600 ~/.ssh/*
91+
# Setup the SSH key
92+
mkdir ~/.ssh
93+
chmod 700 ~/.ssh
94+
echo $SSH_KEY | base64 -d > ~/.ssh/id_rsa
95+
chmod 600 ~/.ssh/*
9696
97-
# Upload Files
98-
scp -o "StrictHostKeyChecking=no" -v -P ${SFTP_PORT} -r . ${SSH_USERNAME}@${SSH_SERVER}:/public_html
97+
# Upload Files
98+
scp -o "StrictHostKeyChecking=no" -v -P ${SFTP_PORT} -r . ${SSH_USERNAME}@${SSH_SERVER}:~/public_html/
9999
100-
# Run any necessary remote commands
101-
ssh -o "StrictHostKeyChecking=no" -v ${SSH_USERNAME}@${SSH_SERVER} -p ${SSH_PORT} 'cd public_html ; composer install --optimize-autoloader; php artisan migrate'
100+
# Run any necessary remote commands
101+
ssh -o "StrictHostKeyChecking=no" -v ${SSH_USERNAME}@${SSH_SERVER} -p ${SSH_PORT} 'cd public_html ; composer install --optimize-autoloader; php artisan migrate'
102102
103103
cache:
104104
paths:

0 commit comments

Comments
 (0)