-
Notifications
You must be signed in to change notification settings - Fork 3
Deploy using Capistrano
Thomas Scherz edited this page Feb 28, 2022
·
2 revisions
- Move the current application directory (probably curate_uc) to a different directory (curate_uc_old).
- Put the variables file in scholar_capistrano/static.
- If you deploying to a protected server (can't access externally), then you need to setup a tunnel to deploy. To do so simply
ssh [email protected] -L 2222:SERVER_NAME:22
. Make sure that you dont close this session, or the deploy won't work. For QA and Dev use the following tunnel commandssh [email protected] -L 2222:SERVER_NAME.private:22 -L 2223:SERVER_NAME.private:22
- If you are doing a local deploy, you need to make sure that you can ssh into your machine. It will make a tmux session called localhost when deploying, which you can access by
tmux attach -t localhost
.
- Make sure that the branch you want to deploy has Capistrano functionality.
- Determine where you want to deploy to (available options are in config/deploy).
- Make sure all changes have been saved and commited to GitHub. If they are not, Capistrano will use what is currently committed.
- Run the command
cap DEPLOY_SERVER deploy
. This will prompt you for the credentials for the user to deploy with. After that, the deploy should start. - At the end of the deploy, you should get a green sentence that says that the deploy was successful.
- Most settings to use for deploys can be changed in their deploy file (Located in config/deploy).
- You can have multiple tunnels by appending -L before each server using the SSH command listed above.
- Capistrano will not change the current release until right before it runs the script at the end. If it fails before then, it will continue to function as normal.