Ruby: Deploying to staging environment
This documentation is part of the Advanced usages guide. You can view the complete guide here: Going further with your Ruby deployments.
👋 Welcome to the Stackhero documentation!
Stackhero offers a ready-to-use Ruby cloud solution that provides a host of benefits, including:
- Deploy your application in seconds with a simple
git push.- Use your own domain name and benefit from the automatic configuration of HTTPS certificates for enhanced security.
- Enjoy peace of mind with automatic backups, one-click updates, and straightforward, transparent, and predictable pricing.
- Get optimal performance and robust security thanks to a private and dedicated VM.
Save time and simplify your life: it only takes 5 minutes to try Stackhero's Ruby cloud hosting solution!
Managing separate environments such as staging and production is highly recommended. As explained in Setting up a staging environment, you can deploy to each environment with different Git remotes.
Begin by renaming the current remote repository. For example, rename the remote "stackhero" to "stackhero-production" with this command:
git remote rename stackhero stackhero-production
Next, create a new Ruby service for the staging environment. Use the provided "git remote add" command and modify it as follows (replace <XXXXXX> with your service's domain):
-
Original command:
git remote add stackhero ssh://stackhero@<XXXXXX>.stackhero-network.com:222/project.git -
Modified command:
git remote add stackhero-staging ssh://stackhero@<XXXXXX>.stackhero-network.com:222/project.git
You can now deploy to staging using:
git push stackhero-staging main
Or deploy to production with:
git push stackhero-production main
To streamline the deployment process further, consider using the improved Makefile version.
With this improved
Makefile, deploying to production or staging can be done easily usingmake deploy-productionormake deploy-staging.