Skip to content

Primitive Namespace

The Pipeline Primitive Namespace is an Autowired Variable called jte that's accessible everywhere.

It can be used to access all the loaded Pipeline Primitives for a given Pipeline Run.

Accessing Libraries and Steps

If libraries were loaded, the jte variable will have a libraries property that stores the library's steps.

Invoking a Step Using The Primitive Namespace

pipeline_config.groovy
libraries{
  npm // contributes a build() step
}
Jenkinsfile
jte.libraries.npm.build()

Accessing Keywords

If Keywords were defined, the jte variable will have a keywords property that stores the Keywords.

Accessing Keywords

pipeline_config.groovy
keywords{
  foo = "bar"
}
Jenkinsfile
assert jte.keywords.foo == "bar"

Accessing Application Environments

If Application Environments were defined, the jte variable will have an application_environments property that stores the Application Environments.

Accessing Application Environments

pipeline_config.groovy
application_environments{
  dev{
    ip = "1.1.1.1"
  }
  prod{
    ip = "2.2.2.2"
  }
}
Jenkinsfile
assert jte.application_environments.dev.ip == "1.1.1.1"
assert jte.application_environments.prod.ip == "2.2.2.2"

Accessing Stages

If Stages were defined, the jte variable will have an stages property that stores the Stages.

Accessing Application Environments

pipeline_config.groovy
libraries{
  npm // contributes unit_test, build
}
stages{
  continuous_integration{
    unit_test
    build
  }
}
Jenkinsfile
jte.stages.continuous_integration()
Back to top