The Problem
Services like DigitalOcean's droplets and Linode's linodes make it super easy to create deployment targets for websites and other Node.js projects. However, there are still a lot of manual steps developers have to do in order to ship the app: install Node, install a runner like pm2
or forever
, install system security patches, zip up & upload the app, create the necessary target directories, and more.
The Solution
Once you define a single configuration .rocketryrc
file, you can run npx deploy run
and everything will be handled for you. Then, with a few other small steps, you can automate the entire process via a CI tool so deployments occur automatically anytime you push changes to your master
branch.
Installation & Usage
For instructions on how to use the tool, see /docs.
Goals & Roadmap
These are the goals for this project:
- [x] Installation & setup of target server
- [x] Install
node
and upgrade it to the latest version - [x] Install
yarn
and upgrade it to the latest version - [x] Install
pm2
and upgrade it to the latest version - [x] Upgrade
apt-get
packages to ensure the latest system security patches are installed
- [x] Install
- [x] Automation of deployment steps
- [x] Create target directories on target server
- [x] Upload local project files to target server via SSH
- [x] Install/upgrade
node
dependencies on target server - [x] Start/restart of services on target server
- [x] Start the application if it's the first deployment, otherwise restart it for updates
- [x] Integration with CI systems for automated deployment triggers
- [x] Automated deployments via username & password
- [ ] Automated deployments via SSH key
- [ ] Seamless deployments without downtime
Other Solutions
How does this project differ from similar existing public projects?
-
Netlify
- It's incredible, but not free past a certain point -
Vercel
- Also incredible, but not free past a certain point -
dploy
- Doesn't support server-side package upgrades -
dployr
- Assumes the Git project is accessible from the server -
shipit
- JavaScript-based (as opposed to configuration-based) and doesn't support server-side package upgrades -
zaz
- Assumes the Git project is accessible from the server
Contributing
Contributions for bug fixes and new features are welcome via Pull Requests.
Publishing a New Version
- Set the version you want in
package.json
(or leave it as is for an auto patch version bump) - Set the same version in
CHANGELOG.md
and put today's date and changes - Run
npm run release
- Set the next version in
package.json
- Add the next block to the
CHANGELOG.md
- Set git tag on the released commit
Simulate a Deployment
To simulate a deployment (to test the script), clone this project and run:
yarn start
LICENSE
MIT