Perfect Development Environment for Remote Teams

DevOps
Git
Workflow
Archive
Set up a remote dev environment on EC2 with Sublime Text SFTP or SSHFS, per-developer Git branches, and automated deployment via post-receive hooks.
Author

B. Talvinder

Published

June 1, 2014

From the Archive

Originally published in 2014 on talvinder.com. Some technical details may be outdated, but this remains here as part of the archive.

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

  1. Easy remote development
  2. Easy version control of personal development
  3. Easy code review and helping each other
  4. Easy deployment to testing and rolling back
  5. Easy deployment to live and rolling back

Easy Remote Development

  1. Install Sublime Text 3
  2. Install Package Manager
  3. Install SFTP plugin: Press cmd + shift + p, type Install Package, then type SFTP
  4. 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 + y to sync local to remote

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):

  1. 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
  1. Download and install osxfuse – make sure you tick the checkbox for MacLayer compatibility
  2. Install SSHFS via Homebrew: brew install sshfs
  3. Create a mount point: mkdir /Volumes/your_volume_name
  4. 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-receive hook on the server pulls and deploys code when you push
  • Separate hooks for testing and production environments
  • Rollback is just git revert or git reset on the server

Enjoyed this?

Get frameworks, build logs, and field notes in your inbox.

No spam. Unsubscribe anytime.