Wrapping your head around a version control system like Git can be somewhat of a challenge, especially if your development workflow centers around SFTP access. Making the leap between the two workflows can be daunting. To help bridge this gap, you can use Vintage Mode: SFTP access to your source code on Pagoda Box. This guide will walk you through how to use Vintage Mode. After reading it, you should understand:
- How Vintage Mode works
- How SFTP Access can be enabled/disabled
- Introducing Git into your SFTP workflow
What is Vintage Mode?
Vintage Mode is a hybrid between SFTP and Git that allows you to use Pagoda Box without having to know Git or make any drastic changes to your SFTP workflow. When enabled, you're given full-write access to your app's codebase on Pagoda Box through an SFTP connection.
We adhere to the practice of never editing live code, so any changes you make to your app through your SFTP client are made in an isolated environment with no traffic. Once you're done editing your code, you deploy your changes by clicking the "Deploy Latest" button in your App Dashboard. Pagoda Box then takes the current state of your app's codebase, creates a git commit point and deploys your changes to your live app. The diagram below illustrates the process:
Enabling/Disabling Vintage Mode
Enabling Vintage mode can be done in two places: 1. While launching an app and 2. In the Admin tab of your app dashboard.
While Launching an App
Whenever you launch an new application, your given the choice of using Git or Vintage mode for deployment.
In the Admin Tab
You can enable or disable Vintage Mode at any time in the Admin tab of your App Dashboard. To enable it, select Vintage Mode for Code Deployment. Choose and confirm your SSH/SFTP password and save your changes.
To disable Vintage Mode, simply select Git as your Code Deployment method and save your changes.
Using Vintage Mode
With Vintage Mode enabled, you can access your application source code using any SFTP client and the following credentials:
In your app's SFTP home directory, you will see four directories: backups, code, logs, and shared. Your codebase is in the "code" directory. Through the sftp portal you have full write-access to your codebase.
Deploying in Vintage Mode
Once you're done editing your code and are ready to push it live, simply click the Deploy latest button in your App Dashboard. Pagoda Box will create a new git commit point and your changes will be deployed.
Rolling Back in Vintage Mode
If a bug is introduced and you need to rollback quickly, simply click the "Undo Last" button in your app dashboard.
Something to Note When Rolling Back
When you rollback or re-deploy to an earlier point, your "code" directory will be reverted to match that point. Any changes made in your rolled-back deploy will be lost, but the commit point will still exist.
Vintage Mode and Shared Writable Directories
All apps on Pagoda Box exist in a read-only environment distributed across multiple servers. To allow apps to write to their own file-structure for things like user-uploads, cached files, sessions, etc., and to ensure all web instances stay in sync, Pagoda Box allows you to specify shared writable directories in your Boxfile. These directories are, as the name implies, shared between all of your app instances.
It is important to note that any changes made to within directories specified as shared writable directories will not be recognized when pushed live. All live shared writable content is housed in the "shared" directory in your SFTP portal. If you must make changes to files in shared writable directories, they should not be made in the "code" directory. They should be made in the "shared" directory. It's also important to note that any changes to files within your shared writables will be live without deploying.
Something Else to Note About Vintage Mode
While in Vintage Mode, you and your collaborators are not allowed use git to push code to your Pagoda Box repo, but you can pull code.