Location: Greeley, CO
Current Gig: Lead Developer at Gueststream, Inc.
One word that best describes how you work: Intensely
Current mobile device: Droid Turbo 2
Current computer: Macbook Pro 15 Read more
Archive for November 2016
I’m Josh Houghtelin, Lead Developer at Gueststream, Inc. and This is How I Work.
Keep FTP in sync with a Git repo
I was tasked with making some changes to a site today over FTP. It seems odd that people are still OK with letting developers push and pull files from FTP without so much as a change log or automated linting, testing, etc. Anywho, I tried to find my cowboy hat but it snowed yesterday so all my summer gear is put away and since it’s moderately inappropriate to do cowboy things while looking like a snowboarder, I had to come up with a better way to make working on files over FTP less Wild West and more Gnar Gnar.
TL;DR
- Setup a cron script to maintain a local mirror of the remote FTP using lftp and automatically commit the changes to a hosted git repo.
- Setup a project in Jenkins to monitor the git repo for changes
- Ignore the commits created by the cron task mirror script
- Lint the project
- Execute a reverse mirror lftp script to push the local changes to the remote FTP host also deleting the files no longer relevant.