パッケージの詳細

rocketry

EvHaus24MIT非推奨0.9.1

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

Deployment script for public websites

automation, continuous, continuous-delivery, deliver

readme

rocketry

rocketry

Simple deployment automation & continuous delivery for Node.js projects.

NPM Status NPM Download Stats License Ci Build Coverage Status


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] 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

更新履歴

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

[0.9.1] - 2021-05-11

Fixed

  • Upgrades for various third-party dependencies

[0.9.0] - 2021-01-20

Fixed

  • Upgrades for various third-party dependencies (some with breaking changes)

[0.8.8] - 2020-07-25

Fixed

  • Upgrades for various third-party dependencies

[0.8.7] - 2020-06-15

Fixed

  • Fixed broken script as a result of shebang removal

[0.8.6] - 2020-06-15

Fixed

  • Upgrades for various third-party dependencies

[0.8.3] - 2020-05-10

Added

  • Added a progress indicator for when the ZIP file is being uploaded

Fixed

  • Fixed a bug which would cause the uploaded ZIP file to hang forever on some servers

[0.8.2] - 2020-05-10

Added

  • Minor improvements to error handling and messaging

[0.8.1] - 2020-05-07

Fixed

  • Upgrades for various third-party dependencies

[0.8.0] - 2020-03-17

Changed

  • Upgrades for various third-party dependencies

[0.7.2] - 2019-11-02

Fixed

  • Fixed broken builds

[0.7.1] - 2019-11-02

Added

  • pm2 now shows full timestamps in logs

[0.7.0] - 2019-10-30

Fixed

  • Fixed an issue preventing config defaults for user or private_key_path from being set correctly

[0.6.2] - 2019-07-08

Fixed

  • Fixed an issue preventing the full stdout value from being seen when the --debug option is enabled

[0.6.1] - 2019-07-08

Added

  • nvm cache is now cleaned up on every run

Fixed

  • If nvm installation failures are detected, the deployment will now abort early.
  • Fixed an issue which would cause "npm: command not found" errors to appear in some cases after nvm installations

[0.6.0] - 2019-06-26

Added

  • Added /docs documentation
  • Added a new rocketry version command to print the current version

Changed

  • Renamed the project to rocketry
  • Renamed the DEPLOY_PW environment variable to ROCKETRY_PW
  • The -v --verbose option has been renamed to -d --debug

Fixed

  • apt-get upgrade commands will no longer stall on upgrades where services starts are required
  • Added wget and curl to the list of installed dependencies as some server instances don't come with it preinstalled

[0.5.2] - 2019-06-10

Fixed

  • Don't validate private_key_path if we're using a password

[0.5.1] - 2019-06-10

Changed

  • "DEPLOY_PW" must now have base64 encoded before use
  • The private_key_path configuration field is now optional

[0.5.0] - 2019-06-10

Added

  • Added support for a "DEPLOY_PW" env variable that can be used a CI secret for automated deployments

[0.4.0] - 2019-05-26

Added

  • Will now install and update pm2 on the target server
  • Now supports a new name configuration option that will set the name of the pm2 application (by default will use the name in the package.json of the app)

Fixed

  • Another attempt to fix an issue causing an exception when upgrading node via nvm

[0.3.14] - 2019-05-24

Fixed

  • Bad deployment

[0.3.13] - 2019-05-24

Fixed

  • Another attempt to figure out why nvm errors are causing crashes

[0.3.12] - 2019-05-24

Fixed

  • Another attempt to fix an issue causing an exception when upgrading node via nvm

[0.3.11] - 2019-05-22

Fixed

  • Fixed an issue causing an exception when upgrading node via nvm

[0.3.10] - 2019-05-18

Fixed

  • A successful nvm upgrade will no longer return an error

[0.3.9] - 2019-05-14

Fixed

  • If a wrong password is entered for the SSH server connection, you will now be prompted to retry
  • Fixed several critical issues related to SSH command submissions

[0.3.8] - 2019-05-13

Fixed

  • Fixed some issues preventing certain commands from working as designed

[0.3.7] - 2019-05-13

Fixed

  • Fixed bug with zip clean up step

[0.3.6] - 2019-05-13

Fixed

  • Deletes the local deployment zip file after its been uploaded

[0.3.5] - 2019-05-12

Fixed

  • Attempt to fix broken first time nvm installation

[0.3.4] - 2019-05-12

Fixed

  • Ensure all apt-get upgrade commands are also set with -y for auto approval

[0.3.3] - 2019-05-12

Fixed

  • Ensure all apt-get install commands are set with -y for auto approval

[0.3.2] - 2019-05-12

Fixed

  • Another attempt at fixing broken builds

[0.3.1] - 2019-05-12

Fixed

  • Fixing published packages

[0.3.0] - 2019-05-12

Added

  • Added documentation to README and added a CHANGELOG
  • Migrated to Flow
  • Added support for installing node and yarn on the server before deployment
  • Added --dir and --verbose options
  • Configuration is now defined via .deployrc file
  • Now supports specifying deployable items via glob paths

[0.2.5] - 2018-06-24

Added

  • Initial release