Perfect Development Environment for Remote Teams
I prefer developing on remote server, since it ensures greater fidelity to the production environment plus awesome portability. I just need a terminal and my .pem key to logon to my servers from anywhere, any laptop.
Recently, I had to setup a full workflow for automated deployments for the whole tech team, who use their own remote servers.
Scenario
- Developers: 3
- Development: remote server (ensures similar environment to production, always accessible)
To Achieve
- Easy remote development
- Easy version control of personal development
- Easy code review and helping each other
- Easy deployment to testing and rolling back
- Easy deployment to live and rolling back
Easy Remote Development
- Install Sublime Text 3
- Install Package Manager
- Install SFTP plugin: Press
cmd + shift + p, typeInstall Package, then typeSFTP - Configure SFTP plugin with your AWS SSH settings:
- Right-click folder in sidebar >
SFTP/FTP > Add Remote mapping - Configure with your server details
- Use keyboard shortcut
cmd + control + u + yto sync local to remote
- Right-click folder in sidebar >
Alternate Route: Map the Drive
If you have a huge codebase, you may want to map the drive to your local system (tested on Mac OSX Mavericks):
- Setup SSH config at
~/.ssh/config:
Host your_ec2_host
HostName your_ec2_hostname
User your_ec2_instance_username_like_ubuntu
IdentityFile ~/path/to/your_ec2_pem.pem
- Download and install osxfuse – make sure you tick the checkbox for MacLayer compatibility
- Install SSHFS via Homebrew:
brew install sshfs - Create a mount point:
mkdir /Volumes/your_volume_name - Mount:
sshfs your_ec2_host:/remote/path /Volumes/your_volume_name
Your remote files now appear as a local folder you can open in any editor.
Easy Version Control
Use separate Git branches per developer. Each developer works on their own branch, merging to master only after review.
Easy Deployment
Set up Git hooks for automated deployment:
post-receivehook on the server pulls and deploys code when you push- Separate hooks for testing and production environments
- Rollback is just
git revertorgit reseton the server