Node Deploy is a app deployment solution that allows you to easily update and execute remote Node.js applications on your remote server using a CLI.
You will need Node.js. For Windows and Mac, you can use the installer. For Linux distributions, follow these simple instructions. Now...
cd
into the project directory, and run:
npm install
This will install all dependencies for client and server.
You should add /bin/nodedeploy
and /bin/nodedeploy-server
to your PATH
so you can use them
anywhere without having to reference the whole path. Node Deploy will interact with Git so you
should be within project folders while you use it.
cd
into the project directory, and run:
nodedeploy-server [port]
This will start the HTTP server that receives client connections. You can specify an optional listen
port as an argument; this defaults to 3333
.
If you get a permission denied error, you need to add executable permission first:
chmod +x nodedeploy-server
Then try again.
To see the help menu, run nodedeploy
without any parameters or pass the --help
argument.
nodedeploy --help
nodedeploy setup
This will start the menu flow, which will prompt for everything it needs from you:
host
: The IP address or host name of the server running Node Deploy.port
: The port in which the server is listening on.username
: The username which should be used for login.password
: The password which should be used for login.projects folder
: The folder on the server that projects should be saved in. Defaults to the remote home directory.token lifespan
: The lifespan in minutes of authentication tokens, defaults to 60 minutes (an hour). This is how often you will have to re-enter your username and password.
This process can only be done once, unless you delete the settings.json
file from the server later.
nodedeploy create --id [project-id] --remote [remote-uri] --branch [git-branch]
[--id/-i]
: An identifier for your project, cannot have spaces, or a few other special characters (which you will find out as you try it out).[--remote/-r]
: A remote Git repo SSH URL, used to download the project on the remote server.[--branch/-b]
: (Optional) Changes the branch that's cloned to the server.
This will clone the project onto the remote server.
nodedeploy list
This will retrieve a simple list of project IDs that exist on the server.
nodedeploy update [project-id] --message [commit-msg] --branch [git-branch]
[project-id]
: The identifier of the project to update.[--message/-m]
: The commit message used to commit local changes to Git before contacting the server.[--branch/-b]
: (Optional) The branch that is used to pull changes on the remote server. Defaults to master.
This will commit and push local changes to Git, then pull them into the project on the remote server.
nodedeploy start [project-id]
[project-id]
: The identifier of the project to start.
This will execute the runner (nodedeploy-server
or app.js
) on the remote server for this project. Output
will be logged into the project directory.
nodedeploy deploy [project-id] --message [commit-msg] --branch [git-branch]
[project-id]
: The identifier of the project to deploy.[--message/-m]
: The commit message used to commit local changes to Git before contacting the server.[--branch/-b]
: (Optional) The branch that is used to pull changes on the remote server. Defaults to master.
This is a combination of update and start; changes will be pulled and it will be executed.
nodedeploy stop [project-id]
[project-id]
: The identifier of the project to stop.
This will kill a started instance of the project.
nodedeploy destroy [project-id]
[project-id]
: The identifier of the project to destroy.
This will destroy (delete) the project folder on the remote server.