Deploy git respository to ftp/sftp server on file-save using Atom


Need to test code on remote ftp/sftp server

For the sake of security and quick deployment, the setup of database in local environment and all server codes have to be reduced to just deploy locally modified files to server and test. For instance, in my case, I am working on front-end web development, but need to test with php codes and mySQL database on remote server.

That means I have to upload files to server each time I want to test a small piece of changed code? In addition, I am working on a git repository, that means logging all work is important for tracking progress and debugging.

Solution I – Time killer

  1. [manual work] git clone the front-end codes
  2. [manual work] Whenever a file is changed
    1. [manual work], upload to ftp/sftp server with your favourite client
  3. [manual work] Test code with your browser
    1. [manual work] Working? Git push
    2. [manual work] Not working? Repeat all the steps

All steps involve human interruption

Solution II – Directly working on remote server

Remote-FTP package for Atom, allows working in local environment as if you were on remote server.
Remote-FTP package for Atom, allows working in local environment as if you were on remote server.
  1. [manual work] Configuration for once
  2. [manual work] Work on target files on server
    1. , and it will be saved and uploaded automatically
  3. [manual work] Test code with your browser
    1. [manual work] Working? Copy all files to git repo directory
      1. [manual work] and git push
    2. [manual work] Not working? Repeat from step 2

Solution III – Auto upload + Working on git repo directly

SFTP-Deployment allows uploading files in git repo directory directly to specific ftp/sftp server directory
SFTP-Deployment allows uploading files in git repo directory directly to specific ftp/sftp server directory
  1. [manual work] Configuration for once
  2. [manual work]Work on git repo
    1. , and it will be saved and uploaded automatically
  3. [manual work]Test code on your browser
    1. [manual work]Working? Git push
      1. Remember? You are working directly on the git repo, yeah!
    2. [manual work]Not working? Repeat from step 2

Conclusion

The last solution works best for local git repo + remote server + database.

Have alternative solutions for this? Share it below 🙂

塗牆

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

您的留言將使用 WordPress.com 帳號。 登出 / 變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 / 變更 )

Facebook照片

您的留言將使用 Facebook 帳號。 登出 / 變更 )

Google+ photo

您的留言將使用 Google+ 帳號。 登出 / 變更 )

連結到 %s