NOTE
StrongLoop Arc and slc are no longer under active development, and will soon be deprecated. Arc's features are being included in the IBM API Connect Developer Toolkit: Please use it instead.
Skip to end of metadata
Go to start of metadata

StrongLoop Arc Build and Deploy enables you to build and deploy Node applications to StrongLoop Process Manager running remotely or locally.

Here, "build" simply means to create a deployable package–either a tar file or a branch of a Git repository–containing everything required to run the application: not only the Node scripts and other content, but also all the required modules (dependencies) that normally go into the node_modules directory, along with any binary artifacts required and compiled as part of the build.  See Installing dependencies for more information.

Icon

You cannot deploy an application to a Windows system; however, you can build and deploy from a Windows system to a remote Process Manager running (for example) on Linux.



In the module picker, click Build & Deploy.  You'll see the Build & Deploy module:


Build and deploy procedure

Icon

Currently, Arc can connect to only to a Process Manager hosting an application with service ID of one (1).

If you have multiple applications deployed to a PM, or to change the service ID of a deployed app, use the slc ctl command.

Follow these steps to build and deploy your application:

  1. Choose a build type: either Git or Tar file.  See Choose build type for details.
  2. If you chose Git, enter the name of the branch to use (default is "deploy").
  3. Click Build.
  4. Click Existing to redeploy an existing Git branch or tar file.   Leave the switch on New if you are deploying the package for the first time.
  5. Start StrongLoop Process Manager on the deployment system.  See Using Process Manager.  
    For a production system, refer to Setting up a production host.
  6. Enter deploy details, then click Deploy.
  7. Confirm deployment by monitoring the console output from the StrongLoop Process Manager and verifying your application is running (for example, loading an API endpoint).

Choose build type

First, decide whether you want to build and deploy using a Git branch or a tar file.

Click Git or Tar file, depending on whether you want to deploy using a Git repository or a .tgz archive file.

NOTE: To use Git, you must:

  • Have Git installed.  Note additional requirements on Windows.
  • Be working in a existing Git repository.  That is, you must have created a Git repository for your application and start Arc in the application root directory.

Click Git to commit the build to a branch of a Git repository.  Committing builds into a Git repository provides robust tracking and storage, including versioning of deployments.  See Committing builds to Git for more information.  You can then deploy the application from the Git branch to StrongLoop Process Manager.

Click Tar file to package the application into a tar file that can be installed with npm install.  See Creating a build archive for more information.  You can then deploy the tar file to StrongLoop Process Manager.

Git build and deploy

Icon

To commit a build to a Git repository, you must have Git installed.

Build to Git

To build to Git, your application must be in a Git repository, and you must be running Arc from a valid clone of the repository.

Committing builds into a Git repository provides the most robust tracking and storage, including versioning of deployments.  See Committing a build to Git for more information.

StrongLoop Arc commits an exact replica of source and build products to a branch, by default named "deploy."   To change the branch name, enter a different name in the Git deploy branch field.

After the commit, the deployment branch tip shows as a merge of the deployment and source branches. This enables you to keep a complete history of deployment builds in Git, separate from the development branches.  

Click Build to commit the build to the specified branch.  For details on what happens when you build, see Building applications with slc.

When the build completes, you'll see the message Successfully built using git.

Choose build source

Click New to create a new Git branch or archive file.  

Click Existing to use the last Git branch or archive file created.

Deploy from Git

Once you have clicked Build to push an application build into a Git repository branch, you can deploy the application from that branch to StrongLoop Process Manager.

But first, you must start StrongLoop Process Manager on the deployment system.  To start Process Manager as a transient process, use the slc pm command, for example:

$ slc pm -l 1234

This starts Process Manager listening on port 1234.  NOTE: By default, StrongLoop Process Manager listens on port 8701; use the -l option to specify a different port.

On production systems, install Process Manager as a service. See Using Process Manager for more information.  

Enter:

  • Git deploy branch - Name of the branch to which you deployed the application (by default, named "deploy").
  • Hostname - Name of the host system you're deploying to.
  • Port - Port number where Process Manager is listening (for example, the argument to the -l option above).
  • Processes - Number of processes to initially run the application in.

Click Deploy to deploy the application to the specified StrongLoop Process Manager instance.

Tar file build and deploy

Build to tar file

Click Build to create a portable archive file, a tar (.tgz) file that can then be installed to StrongLoop Process Manager.

StrongLoop Arc puts the archive file in the parent directory of the application.  The archive file name starts with the application name, followed by the version number specified in package.json, for example, for the initial version of an application called "myapp," the file is myapp-0.0.0.tgz.

You must configure the package.json and .npmignore files, so building the application will ignore deployment (not development) dependencies and build script output.   This is unnecessary when using Git to deploy, but mandatory when creating npm packages!  See Installing dependencies for more information.

When the build process is complete, you'll see the message Successfully built using tar file.

Choose build source

Click New to create a new Git branch or archive file.  

Click Existing to use the last Git branch or archive file created.

Deploy from tar file

Once you have clicked Build to package an application to an archive (tar) file, you can then deploy the archive to StrongLoop Process Manager.

But first, you must start StrongLoop Process Manager on the deployment system.  To start Process Manager as a transient process, use the slc pm command, for example:

$ slc pm -l 1234

This starts Process Manager listening on port 1234.  NOTE: By default, StrongLoop Process Manager listens on port 8701; use the -l option to specify a different port.

On production systems, install Process Manager as a service.  See Using Process Manager for more information. 

Enter:

  • Fully qualified path to archive - File path to the .tgz file containing the application package.
  • Hostname - Name of the host system you're deploying to.
  • Port - Port number where Process Manager is listening (for example, the argument to the -l option above).
  • Processes - Number of processes to initially run the application in.

Click Deploy to deploy the application to the specified StrongLoop Process Manager instance.

REVIEW COMMENT from Rand

Confirm deployment

How do we confirm that the deployment was successful?

  • No labels