Extends the functionality available in the GenericPipeline class. This class adds more advanced functionality to build, test, and deploy your JavaScript/TypeScript application.
@Library('fill this out according to your setup') import org.zowe.jenkins_shared_library.pipelines.nodejs.NodeJSPipeline node('pipeline-node') { // Create the runner and pass the methods available to the workflow script to the runner NodeJSPipeline pipeline = new NodeJSPipeline(this) // Set your config up before calling setup pipeline.admins.add("userid1", "userid2", "userid3") // We have extra branches which can perform release. pipeline.branches.addMap([ [name: "lts-stable", allowRelease: true, allowFormalRelease: true, isProtected: true, npmTag: "lts-stable"] ]) // MUST BE CALLED FIRST pipeline.setup( // Define the git configuration github: [ email: 'robot-user@example.com', usernamePasswordCredential: 'robot-user' ], // Define the artifactory configuration artifactory: [ url : 'https://your-artifactory-url', usernamePasswordCredential : 'artifactory-credential-id', ], // Define install registries installRegistries: [ [email: 'email@example.com', usernamePasswordCredential: 'credentials-id'], [registry: 'https://registry.com', email: 'email@example.com', usernamePasswordCredential: 'credentials-id'] [registry: 'https://registry.com', email: 'email@example.com', usernamePasswordCredential: 'credentials-id', scope: '@myOrg'] ], // Define publish registry publishRegistry: [ email: 'robot-user@example.com', usernamePasswordCredential: 'robot-user' ] ) // Create custom stages for your build like this pipeline.createStage(name: 'Some Stage", stage: { echo "This is my stage" }) // Run a build pipeline.build() // Provide required parameters in your pipeline // Run a test pipeline.test() // Provide required parameters in your pipeline // Run a SonarQube code scan pipeline.sonarScan() // publish artifact to artifactory pipeline.publish() // Provide required parameters in your pipeline // release version bump and git tag pipeline.release() // Provide required parameters in your pipeline // MUST BE CALLED LAST pipeline.end() }
In the example above, the stages will run on a node labeled 'pipeline-node'
. You must
define the node where your pipeline will execute. This node must have the ability to execute an
Expect Script.
Fields inherited from class | Fields |
---|---|
class org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline |
__$stMC, __$stMC |
class org.zowe.jenkins_shared_library.pipelines.base.Pipeline |
__$stMC |
Type | Name and description |
---|---|
org.zowe.jenkins_shared_library.pipelines.base.Branches<org.zowe.jenkins_shared_library.pipelines.nodejs.models.NodeJSBranch> |
branches A map of branches. |
java.util.List<org.zowe.jenkins_shared_library.npm.Registry> |
installRegistries Registries for installing npm dependencies |
java.lang.String |
nodeJsVersion If we have a customized node.js version to use for this pipeline |
java.lang.String |
nvmInitScript Path to nvm.sh. |
org.zowe.jenkins_shared_library.docker.Registry |
publishRegistry Registry for publishing npm package |
Constructor and description |
---|
NodeJSPipeline
(java.lang.Object steps) Constructs the class. |
Type Params | Return Type | Name and description |
---|---|---|
|
protected void |
build(java.util.Map arguments = [:]) Pseudo build method, should be overridden by inherited classes |
|
void |
buildNodeJS(java.util.Map arguments = [:]) Creates a stage that will build a NodeJSPipeline package. |
|
protected void |
bumpVersion() This method overrides and perform version bump on JavaScript project. |
|
protected void |
defineDefaultBranches() Setup default branch settings |
|
void |
loginToInstallRegistries() Login to npm install registries |
|
void |
loginToPublishRegistry() Login to npm publish registry |
|
java.lang.String |
nvmShell(java.lang.Object script) Run shell script under nvm environment |
|
protected void |
publish(java.util.Map arguments = [:]) Pseudo publish method, should be overridden by inherited classes |
|
protected void |
publishNodeJS(java.util.Map arguments = [:]) Publish a Node JS package. |
|
protected void |
setup(java.util.Map arguments = [:]) Pseudo setup method, should be overridden by inherited classes |
|
void |
setupNodeJS(NodeJSSetupStageArguments arguments) Calls org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setupGeneric() to setup the build. |
|
void |
setupNodeJS(java.util.Map arguments = [:]) Initialize the pipeline. |
|
protected void |
test(java.util.Map arguments = [:]) Pseudo test method, should be overridden by inherited classes |
|
void |
testNodeJS(java.util.Map arguments = [:]) Creates a stage that will execute tests on your application. |
Methods inherited from class | Name |
---|---|
class org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline |
org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#isReleaseBranch(java.lang.String), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#isReleaseBranch(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#isFormalReleaseBranch(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#isFormalReleaseBranch(java.lang.String), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#isPerformingRelease(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getPreReleaseString(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getBranchTag(java.lang.String), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getBranchTag(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setupGeneric(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setupGeneric(java.util.Map), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setupGeneric(org.zowe.jenkins_shared_library.pipelines.generic.arguments.GenericSetupStageArguments), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#endGeneric(java.util.Map), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#endGeneric(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#buildGeneric(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#buildGeneric(java.util.Map), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#buildGeneric(org.zowe.jenkins_shared_library.pipelines.generic.arguments.BuildStageArguments), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#testGeneric(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#testGeneric(java.util.Map), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#testGeneric(org.zowe.jenkins_shared_library.pipelines.generic.arguments.TestStageArguments), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#sonarScanGeneric(org.zowe.jenkins_shared_library.pipelines.generic.arguments.SonarScanStageArguments), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#sonarScanGeneric(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#sonarScanGeneric(java.util.Map), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#packagingGeneric(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#packagingGeneric(java.util.Map), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#packagingGeneric(org.zowe.jenkins_shared_library.pipelines.generic.arguments.PackagingStageArguments), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getPublishTargetPath(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getPublishTargetPath(java.util.Map), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#publishGeneric(org.zowe.jenkins_shared_library.pipelines.generic.arguments.PublishStageArguments), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#publishGeneric(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#publishGeneric(java.util.Map), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#uploadArtifacts(java.util.List), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#uploadArtifacts(java.util.List, java.lang.String), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#releaseGeneric(java.util.Map), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#releaseGeneric(org.zowe.jenkins_shared_library.pipelines.generic.arguments.ReleaseStageArguments), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#releaseGeneric(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getBranches(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setBranches(org.zowe.jenkins_shared_library.pipelines.base.Branches), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getChangeInfo(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setPackageInfo(java.util.Map), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getPublishTargetVersion(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setPublishTargetVersion(java.lang.String), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getArtifactoryUploadTargetPath(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setArtifactoryUploadTargetPath(java.lang.String), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getArtifactoryUploadTargetFile(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setArtifactoryUploadTargetFile(java.lang.String), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getGithub(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setGithub(org.zowe.jenkins_shared_library.scm.GitHub), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getGithubTagPrefix(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setGithubTagPrefix(java.lang.String), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getArtifactory(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setArtifactory(org.zowe.jenkins_shared_library.artifact.JFrogArtifactory), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getPax(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setPax(org.zowe.jenkins_shared_library.package.Pax), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#super$2$endBase(org.zowe.jenkins_shared_library.pipelines.base.arguments.EndArguments), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#super$2$endBase(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#super$2$endBase(java.util.Map), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#super$2$$getStaticMetaClass(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#super$2$setupBase(java.util.Map), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#super$2$setupBase(org.zowe.jenkins_shared_library.pipelines.base.arguments.SetupStageArguments), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#super$2$setupBase(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#super$2$setBranches(org.zowe.jenkins_shared_library.pipelines.base.Branches), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#super$2$getBranches(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#super$2$end(java.util.Map), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#super$2$end(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#super$2$setup(java.util.Map), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#super$2$setup(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#super$2$defineDefaultBranches(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setManifest(java.lang.String), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getPackageInfo(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getManifest(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getSteps(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setSteps(java.lang.Object), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setupBase(org.zowe.jenkins_shared_library.pipelines.base.arguments.SetupStageArguments), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setupBase(java.util.Map), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setupBase(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#createStage(java.util.Map), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#createStage(org.zowe.jenkins_shared_library.pipelines.base.arguments.StageArguments), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#addBuildParameter(java.lang.Object), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#addBuildOption(java.lang.Object), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#addBuildParameters([Lorg.jenkinsci.plugins.structs.describable.UninstantiatedDescribable;), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#addBuildParameters(java.util.List), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#addUpstreams([Ljava.lang.String;), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getFirstFailingStage(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getAdmins(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getBuildOptions(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setBuildOptions(java.util.List), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getBuildParameters(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setBuildParameters(java.util.List), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getBuildUpstreams(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setBuildUpstreams(java.util.List), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setVersion(java.lang.String), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#endBase(org.zowe.jenkins_shared_library.pipelines.base.arguments.EndArguments), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#endBase(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#endBase(java.util.Map), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getStage(java.lang.String), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setPackageName(java.lang.String), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setBaseDirectory(java.lang.String), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getVersion(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#invokeMethod(java.lang.String, java.lang.Object), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getMetaClass(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setMetaClass(groovy.lang.MetaClass), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setResult(org.zowe.jenkins_shared_library.pipelines.base.enums.ResultEnum), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getBaseDirectory(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setProperty(java.lang.String, java.lang.Object), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getProperty(java.lang.String), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getPackageName(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#wait(long, int), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#wait(long), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#wait(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#equals(java.lang.Object), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#toString(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#hashCode(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#getClass(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#notify(), org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#notifyAll() |
class org.zowe.jenkins_shared_library.pipelines.base.Pipeline |
org.zowe.jenkins_shared_library.pipelines.base.Pipeline#getSteps(), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#setSteps(java.lang.Object), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#setupBase(org.zowe.jenkins_shared_library.pipelines.base.arguments.SetupStageArguments), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#setupBase(java.util.Map), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#setupBase(), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#getBranches(), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#setBranches(org.zowe.jenkins_shared_library.pipelines.base.Branches), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#createStage(java.util.Map), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#createStage(org.zowe.jenkins_shared_library.pipelines.base.arguments.StageArguments), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#addBuildParameter(java.lang.Object), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#addBuildOption(java.lang.Object), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#addBuildParameters([Lorg.jenkinsci.plugins.structs.describable.UninstantiatedDescribable;), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#addBuildParameters(java.util.List), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#addUpstreams([Ljava.lang.String;), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#getFirstFailingStage(), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#getAdmins(), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#getBuildOptions(), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#setBuildOptions(java.util.List), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#getBuildParameters(), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#setBuildParameters(java.util.List), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#getBuildUpstreams(), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#setBuildUpstreams(java.util.List), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#setVersion(java.lang.String), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#endBase(org.zowe.jenkins_shared_library.pipelines.base.arguments.EndArguments), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#endBase(), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#endBase(java.util.Map), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#getStage(java.lang.String), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#setPackageName(java.lang.String), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#setBaseDirectory(java.lang.String), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#getVersion(), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#invokeMethod(java.lang.String, java.lang.Object), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#getMetaClass(), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#setMetaClass(groovy.lang.MetaClass), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#setResult(org.zowe.jenkins_shared_library.pipelines.base.enums.ResultEnum), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#getBaseDirectory(), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#setProperty(java.lang.String, java.lang.Object), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#getProperty(java.lang.String), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#getPackageName(), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#wait(long, int), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#wait(long), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#wait(), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#equals(java.lang.Object), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#toString(), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#hashCode(), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#getClass(), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#notify(), org.zowe.jenkins_shared_library.pipelines.base.Pipeline#notifyAll() |
A map of branches.
Registries for installing npm dependencies
If we have a customized node.js version to use for this pipeline
Path to nvm.sh.
Registry for publishing npm package
Constructs the class.
When invoking from a Jenkins pipeline script, the NodeJSPipeline must be passed the current environment of the Jenkinsfile to have access to the steps.
def pipeline = new NodeJSPipeline(this)
steps
- The workflow steps object provided by the Jenkins pipelinePseudo build method, should be overridden by inherited classes
arguments
- A map of arguments to be applied to the BuildStageArguments used to define
the stage.Creates a stage that will build a NodeJSPipeline package.
Arguments passed to this function will map to the org.zowe.jenkins_shared_library.pipelines.generic.arguments.BuildStageArguments class.
The stage will be created with the org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#buildGeneric(java.util.Map) method and will have the following additional operations.
npm run build
.arguments
- A map of arguments to be applied to the org.zowe.jenkins_shared_library.pipelines.generic.arguments.BuildStageArguments used to define
the stage.This method overrides and perform version bump on JavaScript project.
By default, the version
defined in package.json
will be bumped with command
npm version patch
.
Setup default branch settings
Login to npm install registries
Login to npm publish registry
Run shell script under nvm environment
script
- which shell script to executePseudo publish method, should be overridden by inherited classes
arguments
- The arguments for the publish step. arguments.operation
must be
provided.Publish a Node JS package.
Arguments passed to this function will map to the org.zowe.jenkins_shared_library.pipelines.generic.arguments.PublishStageArguments class.
The stage will be created with the org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#testGeneric(java.util.Map) method and will have the following additional operations:
npm publish
with defined npmTag of the branch.arguments
- A map of arguments to be applied to the org.zowe.jenkins_shared_library.pipelines.generic.arguments.PublishStageArguments used to define
the stage.Pseudo setup method, should be overridden by inherited classes
arguments
- A map that can be instantiated as org.zowe.jenkins_shared_library.pipelines.nodejs.arguments.NodeJSSetupStageArgumentsCalls org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#setupGeneric() to setup the build.
This method adds extra initialization steps to the default setup "Init Generic Pipeline" stage. The initialization will try to extract package information, like name, version, etc from package.json. And if there is publish registry defined, it will try to run #init() on the Registry instance. Similar to install registries. If there are install registries defined, and credential(s) are provided, the initliazation will try to login to the registries so we can perform npm install without issues.
This step will install all your package dependencies via npm install
or npm ci
. Prior to install
the stage will login to any registries specified in the installRegistries array.
This step will run npm run lint
if the command exists. You can skip this
stage by setting arguments.disableLint to true.
This step will perform dependency vulnerability audit with command npm audit
.
Initialize the pipeline.
arguments
- A map that can be instantiated as org.zowe.jenkins_shared_library.pipelines.nodejs.arguments.NodeJSSetupStageArgumentsPseudo test method, should be overridden by inherited classes
arguments
- A map of arguments to be applied to the org.zowe.jenkins_shared_library.pipelines.generic.arguments.TestStageArguments used to define
the stage.Creates a stage that will execute tests on your application.
Arguments passed to this function will map to the org.zowe.jenkins_shared_library.pipelines.generic.arguments.TestStageArguments class.
The stage will be created with the org.zowe.jenkins_shared_library.pipelines.generic.GenericPipeline#testGeneric(java.util.Map) method and will have the following additional operations:
npm run test
arguments
- A map of arguments to be applied to the org.zowe.jenkins_shared_library.pipelines.generic.arguments.TestStageArguments used to define
the stage.Groovy Documentation