Deploy an Extension to NetSuite
The term deploy refers to what happens when you use Gulp.js to upload source files and any custom changes to a hosted site. To do this, you use the following command:
gulp extension:deploy
This command validates your code, copies them into a local DeployDistribution directory, and updates the manifest.json. The developer tools then upload these files to your NetSuite account, making them available for activation.
For more Gulp.js commands used with extensions, see Extension Developer Gulp Commands.
To deploy your extension to NetSuite:
-
If you have not already done so, fetch the active theme.
This is required before you can deploy an extension. See Fetch Active Theme and Extension Files for details.
-
In your local developer environment, open a command line or terminal and access the top-level development directory.
-
Run the following command:
gulp extension:deploy
Note:For release 2021.2.1 and later accounts that have account-specific domains, specify your account number with the gulp command to enable access to the NetSuite account. For more information about using
gulp extension:deploy --account
, see Extension Developer Gulp Commands.Warning:Potential data loss. Besides compiling and deploying your extension to NetSuite, the
gulp extension:deploy
command updates the manifest.json file for the extension. This action overwrites any manual changes you made to this file. To preserve any manual changes to your manifest.json file, run thegulp extension:deploy --preserve-manifest
command instead. See Edit the Extension Manifest for details on this file. -
When prompted, enter the following information.
-
Unless otherwise directed, create all entries using only alphanumeric characters without spaces.
-
These prompts appear the first time you deploy a new extension to NetSuite. To provide new or changed information, use the
gulp extension:deploy --to
command to deploy your changes.
Select Extension
If you have more than one extension in your developer environment, choose the extension you are deploying.
Authentication ID
Enter an ID to represent your NetSuite account and role.
If you have already created an authentication ID in a previous fetch or deploy operation, the extension developer tools do not prompt you for an ID and will continue to use the existing ID for each subsequent fetch or deploy.
To deploy to a NetSuite account that is different from the account used to create the existing authentication ID, use the
--to
parameter. When you use the use the--to
parameter, you can choose a different authentication ID or create a new one. For more information, see Token Based Authentication.Account and Role
If you are creating a new authentication ID, you need to select the NetSuite account and role to use with that new authentication ID. If using an existing ID, you are not prompted for this information.
In NetSuite, select the account you want to deploy to and the role you want to use for authentication. Click the Allow button to generate the authentication token and secret.
Note:You must specify a role that provides the permissions needed to deploy to NetSuite. By default, the Administrator and SCDeployer roles provide these permissions. To learn more, including how to create a custom role that provides the required permissions, see Developer Tool Roles and Permissions.
Choose Your Website
Choose your site from the list.
Vendor
Enter your partner or business vendor name.
Name
Provide a name for your extension within your development environment.
Fantasy Name
Provide a name for your extension as you want it to appear in the NetSuite user interface. This can contain special characters and spaces.
Version
Add a version number for your extension.
Important:To take advantage of extension update requirements, assign a version number to your extensions. Version numbers should follow this format, where
d
is a single digit:dd.dd.dd
.Description
Provide some text to describe your extension. This string can contain special characters and spaces.
Select Supported Products
Select one of the following options:
-
SuiteCommerce Online – To create an extension for SuiteCommerce or SuiteCommerce Advanced.
-
SuiteCommerce InStore – To create an extension for SuiteCommerce InStore.
An asterisk (*) identifies a selected option. Press the spacebar to select. Use arrow keys to scroll. Press the
A
key to select all. Press theI
key to invert your selections.Target Version
Using Commerce versioning schema, enter a string to declare the target versions to which this extension applies. The developer tools prompt you for a target version for each product specified earlier. Leaving these prompts blank results in compatibility with all versions of the associated Commerce products.
See Declare Target Versions and SuiteScript 2.x Bundle Installation Script Type for more information.
-
-
Activate your new extension for the domain or domains of your choice. See Manage Themes and Extensions for instructions.
Important:Any changes to your extension source code do not apply to your site until you activate the extension for a specific domain using the Manage Extensions wizard in NetSuite. The deploy process includes a notation reminding you of the domain and theme name to set during this process.
What Happens When You Deploy an Extension?
The deployment process is specific to uploading custom extensions to a location in your NetSuite file cabinet. This process does not compile any files or associate any files with a site or domain. To do that, you must activate a theme and include your extensions as necessary.
During the deployment process:
-
The development tools copy all of your custom extension development files (modules and assets) into the DeployDistribution folder in your top-level development directory. If this directory does not exist, the development tools create it.
-
The extension development tools validate your code.
-
The extension development tools upload these files to your NetSuite file cabinet (maintaining the same organizational structure). These are simply your development files. Nothing is compiled or activated at this time.
Note:The
gulp extension:deploy
command uploads your extension development files in groups of files called chunks. A single chunk, by default, contains 80 files. If needed, you can change the number of files in each chunk. See Troubleshooting the Developer Tools for more information.