Enable password-less ssh access:
cat ~/.ssh/id_rsa.pub | ssh username@server "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys"
# shortcut: copyrsaVerify password-less login. (If unsuccessful, make sure the .ssh directory has 700 permissions, and authorized_keys has 600 permissions.)
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keysCreate directory for repository and initialize bare git repository:
mkdir ~/git && cd ~/git
mkdir [myrepo].git && cd [myrepo].git
git init --bare
#shortcut ggitrepoCreate/edit post-receive hook:
nano hooks/post-receivepost-receive
#!/bin/bash
GIT_WORK_TREE=../../[working_directory] git checkout -f master
# shortcut: gpostrec
Make sure post-receive has 755 permissions:
chmod +x hooks/post-receive(Repeat for staging repository/working directory.)
Add a production (and staging) remote:
git remote add [production/staging] ssh://[email protected]/path/to/repo.git
# shortcut: ggraPush to production remote:
git push production HEAD:masterInstall composer dependencies
composer install --no-dev
#shortcut ccindChange .env.example to .env file and generate an application key
mv .env.example .env
php artisan key:generate