Skip to content

Instantly share code, notes, and snippets.

@shnplr
Last active April 8, 2020 08:58
Show Gist options
  • Save shnplr/8bf87e875a2c35987e223dbb79fde10d to your computer and use it in GitHub Desktop.
Save shnplr/8bf87e875a2c35987e223dbb79fde10d to your computer and use it in GitHub Desktop.
OpenShift Jenkins Client Plugin Intellij GDSL
//The global script scope
def ctx = context(scope: scriptScope())
//What things can be on the script scope
contributor(ctx) {
method(name: 'echo', type: 'java.lang.Object', params: [message: 'java.lang.String'], doc: 'Print Message')
method(name: 'node', type: 'java.lang.Object', params: [body: 'Closure'], doc: 'Allocate node')
method(name: 'node', type: 'java.lang.Object', params: [label: 'java.lang.String', body: 'Closure'], doc: 'Allocate node')
method(name: 'pipeline', type: 'java.lang.Object', params: [body: 'Closure'], doc: 'Pipeline root element')
property(name: 'params', type: 'org.jenkinsci.plugins.workflow.cps.ParamsVariable')
property(name: 'env', type: 'org.jenkinsci.plugins.workflow.cps.EnvActionImpl.Binder')
property(name: 'currentBuild', type: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder')
property(name: 'scm', type: 'org.jenkinsci.plugins.workflow.multibranch.SCMVar')
property(name: 'docker', type: 'org.jenkinsci.plugins.docker.workflow.DockerDSL')
property(name: 'pipeline', type: 'org.jenkinsci.plugins.pipeline.modeldefinition.ModelStepLoader')
property(name: 'fileLoader', type: 'org.jenkinsci.plugins.workflow.remoteloader.FileLoaderDSL')
property(name: 'openshift', type: 'com.openshift.jenkins.plugins.pipeline.OpenShiftGlobalVariable')
}
// Define default env vars
def envVars = context(ctype: 'org.jenkinsci.plugins.workflow.cps.EnvActionImpl.Binder')
contributor(envVars) {
property(name: 'BRANCH_NAME', type: 'java.lang.String', doc: 'For a multibranch project, this will be set to the name of the branch being built, for example in case you wish to deploy to production from master but not from feature branches; if corresponding to some kind of change request, the name is generally arbitrary (refer to CHANGE_ID and CHANGE_TARGET).')
property(name: 'CHANGE_ID', type: 'java.lang.String', doc: 'For a multibranch project corresponding to some kind of change request, this will be set to the change ID, such as a pull request number, if supported; else unset.')
property(name: 'CHANGE_URL', type: 'java.lang.String', doc: 'For a multibranch project corresponding to some kind of change request, this will be set to the change URL, if supported; else unset.')
property(name: 'CHANGE_TITLE', type: 'java.lang.String', doc: 'For a multibranch project corresponding to some kind of change request, this will be set to the title of the change, if supported; else unset.')
property(name: 'CHANGE_AUTHOR', type: 'java.lang.String', doc: 'For a multibranch project corresponding to some kind of change request, this will be set to the username of the author of the proposed change, if supported; else unset.')
property(name: 'CHANGE_AUTHOR_DISPLAY_NAME', type: 'java.lang.String', doc: 'For a multibranch project corresponding to some kind of change request, this will be set to the human name of the author, if supported; else unset.')
property(name: 'CHANGE_AUTHOR_EMAIL', type: 'java.lang.String', doc: 'For a multibranch project corresponding to some kind of change request, this will be set to the email address of the author, if supported; else unset.')
property(name: 'CHANGE_TARGET', type: 'java.lang.String', doc: 'rFo a multibranch project corresponding to some kind of change request, this will be set to the target or base branch to which the change could be merged, if supported; else unset.')
property(name: 'BUILD_NUMBER', type: 'java.lang.String', doc: 'The current build number, such as "153"')
property(name: 'BUILD_ID', type: 'java.lang.String', doc: 'The current build ID, identical to BUILD_NUMBER for builds created in 1.597+, but a YYYY-MM-DD_hh-mm-ss timestamp for older builds')
property(name: 'BUILD_DISPLAY_NAME', type: 'java.lang.String', doc: 'The display name of the current build, which is something like "#153" by default.')
property(name: 'JOB_NAME', type: 'java.lang.String', doc: 'Name of the project of this build, such as "foo" or "foo/bar".')
property(name: 'JOB_BASE_NAME', type: 'java.lang.String', doc: 'Short Name of the project of this build stripping off folder paths, such as "foo" for "bar/foo".')
property(name: 'BUILD_TAG', type: 'java.lang.String', doc: 'String of "jenkins-${JOB_NAME}-${BUILD_NUMBER}". All forward slashes (/) in the JOB_NAME are replaced with dashes (-). Convenient to put into a resource file, a jar file, etc for easier identification.')
property(name: 'EXECUTOR_NUMBER', type: 'java.lang.String', doc: 'The unique number that identifies the current executor (among executors of the same machine) that’s carrying out this build. This is the number you see in the "build executor status", except that the number starts from 0, not 1.')
property(name: 'NODE_NAME', type: 'java.lang.String', doc: 'Name of the agent if the build is on an agent, or "master" if run on master')
property(name: 'NODE_LABELS', type: 'java.lang.String', doc: 'Whitespace-separated list of labels that the node is assigned.')
property(name: 'WORKSPACE', type: 'java.lang.String', doc: 'The absolute path of the directory assigned to the build as a workspace.')
property(name: 'JENKINS_HOME', type: 'java.lang.String', doc: 'The absolute path of the directory assigned on the master node for Jenkins to store data.')
property(name: 'JENKINS_URL', type: 'java.lang.String', doc: 'Full URL of Jenkins, like http://server:port/jenkins/ (note: only available if Jenkins URL set in system configuration)')
property(name: 'BUILD_URL', type: 'java.lang.String', doc: 'Full URL of this build, like http://server:port/jenkins/job/foo/15/ (Jenkins URL must be set)')
property(name: 'JOB_URL', type: 'java.lang.String', doc: 'Full URL of this job, like http://server:port/jenkins/job/foo/ (Jenkins URL must be set)')
}
// Define all the properties in current builds
def currentBuild = context(ctype: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder')
contributor(currentBuild) {
property(name: 'number', type: 'Integer', doc: 'build number')
property(name: 'result', type: 'java.lang.String', doc: 'typically SUCCESS, UNSTABLE, or FAILURE (may be null for an ongoing build)')
property(name: 'currentResult', type: 'java.lang.String', doc: 'typically SUCCESS, UNSTABLE, or FAILURE (never null)')
method(name: 'resultIsBetterOrEqualTo', type: 'java.lang.Boolean', params: [buildStatus: 'java.lang.String'], doc: 'Compares the current build result to the provided result string (SUCCESS, UNSTABLE, or FAILURE) and returns true if the current build result is better than or equal to the provided result.')
method(name: 'resultIsWorseOrEqualTo', type: 'java.lang.Boolean', params: [buildStatus: 'java.lang.String'], doc: 'Compares the current build result to the provided result string (SUCCESS, UNSTABLE, or FAILURE) and returns true if the current build result is worse than or equal to the provided result.')
property(name: 'displayName', type: 'java.lang.String', doc: 'normally #123 but sometimes set to, e.g., an SCM commit identifier')
property(name: 'description', type: 'java.lang.String', doc: 'additional information about the build')
property(name: 'id', type: 'java.lang.String', doc: 'normally number as a string')
property(name: 'timeInMillis', type: 'long', doc: 'time since the epoch when the build was scheduled')
property(name: 'startTimeInMillis', type: 'long', doc: 'time since the epoch when the build started running')
property(name: 'duration', type: 'long', doc: 'duration of the build in milliseconds')
property(name: 'durationString', type: 'java.lang.String', doc: 'a human-readable representation of the build duration')
property(name: 'previousBuild', type: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder', doc: 'another similar object, or null')
property(name: 'nextBuild', type: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder', doc: 'another similar object, or null')
property(name: 'absoluteUrl', type: 'java.lang.String', doc: 'URL of build index page')
property(name: 'buildVariables', type: 'java.util.Map', doc: 'for a non-Pipeline downstream build, offers access to a map of defined build variables; for a Pipeline downstream build, any variables set globally on env')
property(name: 'changeSets', type: 'java.lang.String', doc: 'a list of changesets coming from distinct SCM checkouts; each has a kind and is a list of commits; each commit has a commitId, timestamp, msg, author, and affectedFiles each of which has an editType and path; the value will not generally be Serializable so you may only access it inside a method marked @NonCPS')
property(name: 'rawBuild', type: 'java.lang.String', doc: 'a hudson.model.Run with further APIs, only for trusted libraries or administrator-approved scripts outside the sandbox; the value will not be Serializable so you may only access it inside a method marked @NonCPS')
}
def closures = context(scope: closureScope())
contributor(closures) {
// What things can be inside a node
if (enclosingCall("node")) {
method(name: 'openshiftBuild', type: 'java.lang.Object', params: [bldCfg: 'java.lang.String'], doc: 'Trigger OpenShift Build')
method(name: 'openshiftBuild', type: 'java.lang.Object', namedParams: [parameter(name: 'bldCfg', type: 'java.lang.String'), parameter(name: 'apiURL', type: 'java.lang.String'), parameter(name: 'authToken', type: 'java.lang.String'), parameter(name: 'buildName', type: 'java.lang.String'), parameter(name: 'checkForTriggeredDeployments', type: 'java.lang.String'), parameter(name: 'commitID', type: 'java.lang.String'), parameter(name: 'env', type: 'java.util.Map'), parameter(name: 'namespace', type: 'java.lang.String'), parameter(name: 'showBuildLogs', type: 'java.lang.String'), parameter(name: 'verbose', type: 'java.lang.String'), parameter(name: 'waitTime', type: 'java.lang.String'), parameter(name: 'waitUnit', type: 'java.lang.String'),], doc: 'Trigger OpenShift Build')
method(name: 'openshiftCreateResource', type: 'java.lang.Object', params: [jsonyaml: 'java.lang.String'], doc: 'Create OpenShift Resource(s)')
method(name: 'openshiftCreateResource', type: 'java.lang.Object', namedParams: [parameter(name: 'jsonyaml', type: 'java.lang.String'), parameter(name: 'apiURL', type: 'java.lang.String'), parameter(name: 'authToken', type: 'java.lang.String'), parameter(name: 'namespace', type: 'java.lang.String'), parameter(name: 'verbose', type: 'java.lang.String'),], doc: 'Create OpenShift Resource(s)')
method(name: 'openshiftDeleteResourceByJsonYaml', type: 'java.lang.Object', params: [jsonyaml: 'java.lang.String'], doc: 'Delete OpenShift Resource(s) from JSON or YAML')
method(name: 'openshiftDeleteResourceByJsonYaml', type: 'java.lang.Object', namedParams: [parameter(name: 'jsonyaml', type: 'java.lang.String'), parameter(name: 'apiURL', type: 'java.lang.String'), parameter(name: 'authToken', type: 'java.lang.String'), parameter(name: 'namespace', type: 'java.lang.String'), parameter(name: 'verbose', type: 'java.lang.String'),], doc: 'Delete OpenShift Resource(s) from JSON or YAML')
method(name: 'openshiftDeleteResourceByKey', type: 'java.lang.Object', namedParams: [parameter(name: 'types', type: 'java.lang.String'), parameter(name: 'keys', type: 'java.lang.String'), parameter(name: 'apiURL', type: 'java.lang.String'), parameter(name: 'authToken', type: 'java.lang.String'), parameter(name: 'namespace', type: 'java.lang.String'), parameter(name: 'verbose', type: 'java.lang.String'),], doc: 'Delete OpenShift Resource(s) by Key')
method(name: 'openshiftDeleteResourceByLabels', type: 'java.lang.Object', namedParams: [parameter(name: 'types', type: 'java.lang.String'), parameter(name: 'keys', type: 'java.lang.String'), parameter(name: 'values', type: 'java.lang.String'), parameter(name: 'apiURL', type: 'java.lang.String'), parameter(name: 'authToken', type: 'java.lang.String'), parameter(name: 'namespace', type: 'java.lang.String'), parameter(name: 'verbose', type: 'java.lang.String'),], doc: 'Delete OpenShift Resource(s) using Labels')
method(name: 'openshiftDeploy', type: 'java.lang.Object', params: [depCfg: 'java.lang.String'], doc: 'Trigger OpenShift Deployment')
method(name: 'openshiftDeploy', type: 'java.lang.Object', namedParams: [parameter(name: 'depCfg', type: 'java.lang.String'), parameter(name: 'apiURL', type: 'java.lang.String'), parameter(name: 'authToken', type: 'java.lang.String'), parameter(name: 'namespace', type: 'java.lang.String'), parameter(name: 'verbose', type: 'java.lang.String'), parameter(name: 'waitTime', type: 'java.lang.String'), parameter(name: 'waitUnit', type: 'java.lang.String'),], doc: 'Trigger OpenShift Deployment')
method(name: 'openshiftExec', type: 'java.lang.Object', params: [pod: 'java.lang.String'], doc: 'OpenShift Exec')
method(name: 'openshiftExec', type: 'java.lang.Object', namedParams: [parameter(name: 'pod', type: 'java.lang.String'), parameter(name: 'apiURL', type: 'java.lang.String'), parameter(name: 'arguments', type: 'java.util.Map'), parameter(name: 'authToken', type: 'java.lang.String'), parameter(name: 'command', type: 'java.lang.String'), parameter(name: 'container', type: 'java.lang.String'), parameter(name: 'namespace', type: 'java.lang.String'), parameter(name: 'verbose', type: 'java.lang.String'), parameter(name: 'waitTime', type: 'java.lang.String'), parameter(name: 'waitUnit', type: 'java.lang.String'),], doc: 'OpenShift Exec')
method(name: 'openshiftImageStream', type: 'java.lang.Object', params: [:], doc: 'OpenShift ImageStreams')
method(name: 'openshiftImageStream', type: 'java.lang.Object', namedParams: [parameter(name: 'name', type: 'java.lang.String'), parameter(name: 'tag', type: 'java.lang.String'), parameter(name: 'namespace', type: 'java.lang.String'), parameter(name: 'apiURL', type: 'java.lang.String'), parameter(name: 'authToken', type: 'java.lang.String'), parameter(name: 'changelog', type: 'java.lang.Boolean'), parameter(name: 'poll', type: 'java.lang.Boolean'), parameter(name: 'verbose', type: 'java.lang.String'),], doc: 'OpenShift ImageStreams')
method(name: 'openshiftScale', type: 'java.lang.Object', namedParams: [parameter(name: 'depCfg', type: 'java.lang.String'), parameter(name: 'replicaCount', type: 'java.lang.String'), parameter(name: 'apiURL', type: 'java.lang.String'), parameter(name: 'authToken', type: 'java.lang.String'), parameter(name: 'namespace', type: 'java.lang.String'), parameter(name: 'verbose', type: 'java.lang.String'), parameter(name: 'verifyReplicaCount', type: 'java.lang.String'), parameter(name: 'waitTime', type: 'java.lang.String'), parameter(name: 'waitUnit', type: 'java.lang.String'),], doc: 'Scale OpenShift Deployment')
method(name: 'openshiftTag', type: 'java.lang.Object', namedParams: [parameter(name: 'srcStream', type: 'java.lang.String'), parameter(name: 'srcTag', type: 'java.lang.String'), parameter(name: 'destStream', type: 'java.lang.String'), parameter(name: 'destTag', type: 'java.lang.String'), parameter(name: 'alias', type: 'java.lang.String'), parameter(name: 'apiURL', type: 'java.lang.String'), parameter(name: 'authToken', type: 'java.lang.String'), parameter(name: 'destinationAuthToken', type: 'java.lang.String'), parameter(name: 'destinationNamespace', type: 'java.lang.String'), parameter(name: 'namespace', type: 'java.lang.String'), parameter(name: 'verbose', type: 'java.lang.String'),], doc: 'Tag OpenShift Image')
method(name: 'openshiftVerifyBuild', type: 'java.lang.Object', params: [bldCfg: 'java.lang.String'], doc: 'Verify OpenShift Build')
method(name: 'openshiftVerifyBuild', type: 'java.lang.Object', namedParams: [parameter(name: 'bldCfg', type: 'java.lang.String'), parameter(name: 'apiURL', type: 'java.lang.String'), parameter(name: 'authToken', type: 'java.lang.String'), parameter(name: 'checkForTriggeredDeployments', type: 'java.lang.String'), parameter(name: 'namespace', type: 'java.lang.String'), parameter(name: 'verbose', type: 'java.lang.String'), parameter(name: 'waitTime', type: 'java.lang.String'), parameter(name: 'waitUnit', type: 'java.lang.String'),], doc: 'Verify OpenShift Build')
method(name: 'openshiftVerifyDeployment', type: 'java.lang.Object', params: [depCfg: 'java.lang.String'], doc: 'Verify OpenShift Deployment')
method(name: 'openshiftVerifyDeployment', type: 'java.lang.Object', namedParams: [parameter(name: 'depCfg', type: 'java.lang.String'), parameter(name: 'apiURL', type: 'java.lang.String'), parameter(name: 'authToken', type: 'java.lang.String'), parameter(name: 'namespace', type: 'java.lang.String'), parameter(name: 'replicaCount', type: 'java.lang.String'), parameter(name: 'verbose', type: 'java.lang.String'), parameter(name: 'verifyReplicaCount', type: 'java.lang.String'), parameter(name: 'waitTime', type: 'java.lang.String'), parameter(name: 'waitUnit', type: 'java.lang.String'),], doc: 'Verify OpenShift Deployment')
method(name: 'openshiftVerifyService', type: 'java.lang.Object', params: [svcName: 'java.lang.String'], doc: 'Verify OpenShift Service')
method(name: 'openshiftVerifyService', type: 'java.lang.Object', namedParams: [parameter(name: 'svcName', type: 'java.lang.String'), parameter(name: 'apiURL', type: 'java.lang.String'), parameter(name: 'authToken', type: 'java.lang.String'), parameter(name: 'namespace', type: 'java.lang.String'), parameter(name: 'retryCount', type: 'java.lang.String'), parameter(name: 'verbose', type: 'java.lang.String'),], doc: 'Verify OpenShift Service')
}
// What things can be inside a pipeline
if (enclosingCall("pipeline")) {
method(name: 'stages', type: 'java.lang.Object', params: [body: 'Closure'], doc: 'Stages')
//method(name: 'agent', type: 'java.lang.Object', params: [body: 'Closure'], doc: 'Label expression to select agents')
method(name: 'agent', type: 'java.lang.Object', params: [body: 'Object'], doc: 'Label expression to select agents')
method(name: 'parameters', type: 'java.lang.Object', params: [body: 'Closure'], doc: 'Job parameters')
method(name: 'environment', type: 'java.lang.Object', params: [body: 'Closure'])
method(name: 'options', type: 'java.lang.Object', params: [body: 'Closure'])
method(name: 'triggers', type: 'java.lang.Object', params: [body: 'Closure'], doc: 'Build triggers')
method(name: 'post', type: 'java.lang.Object', params: [body: 'Closure'], doc: 'Post build actions')
method(name: 'jiraComment', type: 'java.lang.Object', namedParams: [parameter(name: 'issueKey', type: 'java.lang.String'), parameter(name: 'body', type: 'java.lang.String'),], doc: 'JIRA: Add a comment to issue(s)')
method(name: 'jiraIssueSelector', type: 'java.lang.Object', params: [:], doc: 'JIRA: Issue selector')
method(name: 'jiraIssueSelector', type: 'java.lang.Object', namedParams: [parameter(name: 'issueSelector', type: 'java.util.Map'),], doc: 'JIRA: Issue selector')
method(name: 'jiraSearch', type: 'java.lang.Object', params: [jql: 'java.lang.String'], doc: 'JIRA: Search issues')
//I don't know the fate of these one
method(name: 'build', type: 'java.lang.Object', params: [job: 'java.lang.String'], doc: 'Build a job')
method(name: 'build', type: 'java.lang.Object', namedParams: [parameter(name: 'job', type: 'java.lang.String'), parameter(name: 'parameters', type: 'java.util.Map'), parameter(name: 'propagate', type: 'java.lang.Boolean'), parameter(name: 'quietPeriod', type: 'java.lang.Integer'), parameter(name: 'wait', type: 'java.lang.Boolean'),], doc: 'Build a job')
method(name: 'ec2', type: 'java.lang.Object', namedParams: [parameter(name: 'cloud', type: 'java.lang.String'), parameter(name: 'template', type: 'java.lang.String'),], doc: 'Cloud template provisioning')
method(name: 'error', type: 'java.lang.Object', params: [message: 'java.lang.String'], doc: 'Error signal')
method(name: 'input', type: 'java.lang.Object', params: [body: 'Closure'], doc: 'Wait for interactive input')
method(name: 'input', type: 'java.lang.Object', params: [message: 'java.lang.String'], doc: 'Wait for interactive input')
method(name: 'input', type: 'java.lang.Object', namedParams: [parameter(name: 'message', type: 'java.lang.String'), parameter(name: 'id', type: 'java.lang.String'), parameter(name: 'ok', type: 'java.lang.String'), parameter(name: 'parameters', type: 'java.util.List'), parameter(name: 'submitter', type: 'java.lang.String'), parameter(name: 'submitterParameter', type: 'java.lang.String'),], doc: 'Wait for interactive input')
method(name: 'isUnix', type: 'java.lang.Object', params: [:], doc: 'Checks if running on a Unix-like node')
method(name: 'library', type: 'java.lang.Object', params: [identifier: 'java.lang.String'], doc: 'Load a shared library on the fly')
method(name: 'library', type: 'java.lang.Object', namedParams: [parameter(name: 'identifier', type: 'java.lang.String'), parameter(name: 'changelog', type: 'java.lang.Boolean'), parameter(name: 'retriever', type: 'java.util.Map'),], doc: 'Load a shared library on the fly')
method(name: 'libraryResource', type: 'java.lang.Object', params: [resource: 'java.lang.String'], doc: 'Load a resource file from a shared library')
method(name: 'libraryResource', type: 'java.lang.Object', namedParams: [parameter(name: 'resource', type: 'java.lang.String'), parameter(name: 'encoding', type: 'java.lang.String'),], doc: 'Load a resource file from a shared library')
method(name: 'lock', type: 'java.lang.Object', params: [resource: 'java.lang.String', body: 'Closure'], doc: 'Lock shared resource')
method(name: 'lock', type: 'java.lang.Object', params: [body: 'Closure'], namedParams: [parameter(name: 'resource', type: 'java.lang.String'), parameter(name: 'extra', type: 'java.util.Map'), parameter(name: 'inversePrecedence', type: 'java.lang.Boolean'), parameter(name: 'label', type: 'java.lang.String'), parameter(name: 'quantity', type: 'int'), parameter(name: 'variable', type: 'java.lang.String'),], doc: 'Lock shared resource')
method(name: 'mail', type: 'java.lang.Object', namedParams: [parameter(name: 'subject', type: 'java.lang.String'), parameter(name: 'body', type: 'java.lang.String'), parameter(name: 'bcc', type: 'java.lang.String'), parameter(name: 'cc', type: 'java.lang.String'), parameter(name: 'charset', type: 'java.lang.String'), parameter(name: 'from', type: 'java.lang.String'), parameter(name: 'mimeType', type: 'java.lang.String'), parameter(name: 'replyTo', type: 'java.lang.String'), parameter(name: 'to', type: 'java.lang.String'),], doc: 'Mail')
method(name: 'milestone', type: 'java.lang.Object', params: [ordinal: 'java.lang.Integer'], doc: 'The milestone step forces all builds to go through in order')
method(name: 'milestone', type: 'java.lang.Object', namedParams: [parameter(name: 'ordinal', type: 'java.lang.Integer'), parameter(name: 'label', type: 'java.lang.String'),], doc: 'The milestone step forces all builds to go through in order')
// method(name: 'node', type: 'java.lang.Object', params: [body: 'Closure'], doc: 'Allocate node')
// method(name: 'node', type: 'java.lang.Object', params: [label: 'java.lang.String', body: 'Closure'], doc: 'Allocate node')
method(name: 'nodesByLabel', type: 'java.lang.Object', params: [label: 'java.lang.String'], doc: 'List of nodes by Label, by default excludes offline nodes.')
method(name: 'nodesByLabel', type: 'java.lang.Object', namedParams: [parameter(name: 'label', type: 'java.lang.String'), parameter(name: 'offline', type: 'java.lang.Boolean'),], doc: 'List of nodes by Label, by default excludes offline nodes.')
method(name: 'properties', type: 'java.lang.Object', params: [properties: 'java.util.Map'], doc: 'Set job properties')
method(name: 'readJSON', type: 'java.lang.Object', params: [:], doc: 'Read JSON from files in the workspace.')
method(name: 'readJSON', type: 'java.lang.Object', namedParams: [parameter(name: 'file', type: 'java.lang.String'), parameter(name: 'text', type: 'java.lang.String'),], doc: 'Read JSON from files in the workspace.')
method(name: 'readManifest', type: 'java.lang.Object', params: [:], doc: 'Read a Jar Manifest')
method(name: 'readManifest', type: 'java.lang.Object', namedParams: [parameter(name: 'file', type: 'java.lang.String'), parameter(name: 'text', type: 'java.lang.String'),], doc: 'Read a Jar Manifest')
method(name: 'readProperties', type: 'java.lang.Object', params: [:], doc: 'Read properties from files in the workspace or text.')
method(name: 'readProperties', type: 'java.lang.Object', namedParams: [parameter(name: 'defaults', type: 'java.util.Map'), parameter(name: 'file', type: 'java.lang.String'), parameter(name: 'interpolate', type: 'java.lang.Boolean'), parameter(name: 'text', type: 'java.lang.String'),], doc: 'Read properties from files in the workspace or text.')
method(name: 'readTrusted', type: 'java.lang.Object', params: [path: 'java.lang.String'], doc: 'Read trusted file from SCM')
method(name: 'readYaml', type: 'java.lang.Object', params: [:], doc: 'Read yaml from files in the workspace or text.')
method(name: 'readYaml', type: 'java.lang.Object', namedParams: [parameter(name: 'file', type: 'java.lang.String'), parameter(name: 'text', type: 'java.lang.String'),], doc: 'Read yaml from files in the workspace or text.')
method(name: 'resolveScm', type: 'java.lang.Object', namedParams: [parameter(name: 'source', type: 'java.util.Map'), parameter(name: 'targets', type: 'java.util.Map'), parameter(name: 'ignoreErrors', type: 'java.lang.Boolean'),], doc: 'Resolves an SCM from an SCM Source and a list of candidate target branch names')
method(name: 'retry', type: 'java.lang.Object', params: [count: 'int', body: 'Closure'], doc: 'Retry the body up to N times')
method(name: 'script', type: 'java.lang.Object', params: [body: 'Closure'], doc: 'Run arbitrary Pipeline script')
method(name: 'sleep', type: 'java.lang.Object', params: [time: 'int'], doc: 'Sleep')
method(name: 'sleep', type: 'java.lang.Object', namedParams: [parameter(name: 'time', type: 'int'), parameter(name: 'unit', type: 'java.util.concurrent.TimeUnit'),], doc: 'Sleep')
method(name: 'timeout', type: 'java.lang.Object', params: [time: 'int', body: 'Closure'], doc: 'Enforce time limit')
method(name: 'timeout', type: 'java.lang.Object', params: [body: 'Closure'], namedParams: [parameter(name: 'time', type: 'java.lang.Integer'), parameter(name: 'activity', type: 'java.lang.Boolean'), parameter(name: 'unit', type: 'java.lang.String'),], doc: 'Enforce time limit')
method(name: 'tool', type: 'java.lang.Object', params: [name: 'java.lang.String'], doc: 'Use a tool from a predefined Tool Installation')
method(name: 'tool', type: 'java.lang.Object', namedParams: [parameter(name: 'name', type: 'java.lang.String'), parameter(name: 'type', type: 'java.lang.String'),], doc: 'Use a tool from a predefined Tool Installation')
method(name: 'waitUntil', type: 'java.lang.Object', params: [body: 'Closure'], doc: 'Wait for condition')
method(name: 'withCredentials', type: 'java.lang.Object', params: [bindings: 'java.util.Map', body: 'Closure'], doc: 'Bind credentials to variables')
method(name: 'withEnv', type: 'java.lang.Object', params: [overrides: 'java.util.Map', body: 'Closure'], doc: 'Set environment variables')
method(name: 'ws', type: 'java.lang.Object', params: [dir: 'java.lang.String', body: 'Closure'], doc: 'Allocate workspace')
method(name: 'catchError', type: 'java.lang.Object', params: [body: 'Closure'], doc: 'Advanced/Deprecated Catch error and set build result')
method(name: 'dockerFingerprintRun', type: 'java.lang.Object', params: [containerId: 'java.lang.String'], doc: 'Advanced/Deprecated Record trace of a Docker image run in a container')
method(name: 'dockerFingerprintRun', type: 'java.lang.Object', namedParams: [parameter(name: 'containerId', type: 'java.lang.String'), parameter(name: 'toolName', type: 'java.lang.String'),], doc: 'Record trace of a Docker image run in a container')
method(name: 'envVarsForTool', type: 'java.lang.Object', namedParams: [parameter(name: 'toolId', type: 'java.lang.String'), parameter(name: 'toolVersion', type: 'java.lang.String'),], doc: 'Fetches the environment variables for a given tool in a list of \'FOO=bar\' strings suitable for the withEnv step.')
method(name: 'getContext', type: 'java.lang.Object', params: [type: 'java.util.Map'], doc: 'Advanced/Deprecated Get contextual object from internal APIs')
method(name: 'podTemplate', type: 'java.lang.Object', params: [body: 'Closure'], namedParams: [parameter(name: 'label', type: 'java.lang.String'), parameter(name: 'name', type: 'java.lang.String'), parameter(name: 'activeDeadlineSeconds', type: 'int'), parameter(name: 'annotations', type: 'java.util.Map'), parameter(name: 'cloud', type: 'java.lang.String'), parameter(name: 'containers', type: 'java.util.Map'), parameter(name: 'envVars', type: 'java.util.Map'), parameter(name: 'idleMinutes', type: 'int'), parameter(name: 'imagePullSecrets', type: 'java.util.Map'), parameter(name: 'inheritFrom', type: 'java.lang.String'), parameter(name: 'instanceCap', type: 'int'), parameter(name: 'namespace', type: 'java.lang.String'), parameter(name: 'nodeSelector', type: 'java.lang.String'), parameter(name: 'nodeUsageMode', type: 'java.lang.String'), parameter(name: 'podRetention', type: 'java.util.Map'), parameter(name: 'serviceAccount', type: 'java.lang.String'), parameter(name: 'slaveConnectTimeout', type: 'int'), parameter(name: 'volumes', type: 'java.util.Map'), parameter(name: 'workingDir', type: 'java.lang.String'), parameter(name: 'workspaceVolume', type: 'java.util.Map'), parameter(name: 'yaml', type: 'java.lang.String'),], doc: 'Define a podTemplate to use in the kubernetes plugin')
method(name: 'withContext', type: 'java.lang.Object', params: [context: 'java.lang.Object', body: 'Closure'], doc: 'Advanced/Deprecated Use contextual object from internal APIs within a block')
}
//The only thing inside agent can be label
if (enclosingCall("agent")) {
property(name: 'any')
property(name: 'none')
method(name: 'label', type: 'java.lang.String', params: [expr: 'java.lang.String'])
method(name: 'docker', type: 'java.lang.String', params: [docker_image: 'java.lang.String'])
method(name: 'dockerfile', type: 'java.lang.Boolean', params: [use_dockerfile: 'java.lang.Boolean'])
}
if (enclosingCall("triggers")) {
method(name: 'cron', type: 'java.lang.String', params: [expr: 'java.lang.String'], doc: 'Cron expression can be one of @daily, @hourly, etc')
method(name: 'upstream', type: 'java.lang.Object', params: [name: 'java.lang.String', build_status: 'java.lang.Object'])
method(name: 'pollSCM', type: 'java.lang.String', params: [expr: 'java.lang.String'])
method(name: 'bitbucketPush')
}
// Parameters can only contain
if (enclosingCall("parameters")) {
method(name: 'string', type: 'java.lang.Object', namedParams: [parameter(name: 'name', type: 'java.lang.String'), parameter(name: 'defaultValue', type: 'java.lang.String'), parameter(name: 'description', type: 'java.lang.String')])
method(name: 'booleanParam', type: 'java.lang.Object', namedParams: [parameter(name: 'name', type: 'java.lang.String'), parameter(name: 'defaultValue', type: 'java.lang.Boolean'), parameter(name: 'description', type: 'java.lang.String')])
method(name: 'choice', type: 'java.lang.Object', namedParams: [parameter(name: 'name', type: 'java.lang.String'), parameter(name: 'choices', type: 'java.util.List'), parameter(name: 'description', type: 'java.lang.String')])
method(name: 'text', type: 'java.lang.Object', namedParams: [parameter(name: 'name', type: 'java.lang.String'), parameter(name: 'defaultValue', type: 'java.lang.String'), parameter(name: 'description', type: 'java.lang.String')])
method(name: 'password', type: 'java.lang.Object', namedParams: [parameter(name: 'name', type: 'java.lang.String'), parameter(name: 'defaultValue', type: 'java.lang.String'), parameter(name: 'description', type: 'java.lang.String')])
}
// Find the options!
if (enclosingCall("options")) {
method(name: 'buildDiscarder')
method(name: 'timestamps')
method(name: 'timeout', type: 'java.lang.Object', namedParams: [parameter(name: 'time', type: 'java.lang.Integer'), parameter(name: 'unit', type: 'java.lang.String')])
}
// Inside stages can be, stage or stage('Name')
if (enclosingCall("stages")) {
method(name: 'stage', type: 'java.lang.Object', params: [name: 'java.lang.String', body: 'Closure'], doc: 'Stage')
method(name: 'stage', type: 'java.lang.Object', params: [body: 'Closure'], namedParams: [parameter(name: 'name', type: 'java.lang.String'), parameter(name: 'concurrency', type: 'java.lang.Integer'),], doc: 'Stage')
}
// Inside stage only steps
if (enclosingCall("stage")) {
method(name: 'agent', type: 'java.lang.Object', params: [body: 'java.lang.Object'], doc: 'Label expression to select agents')
method(name: 'steps', type: 'java.lang.Object', params: [body: 'Closure'], doc: 'Steps to execute on stage')
method(name: 'post', type: 'java.lang.Object', params: [body: 'Closure'], doc: 'Post actions can be executed on a per-stage basis as well')
method(name: 'when', type: 'java.lang.Object', params: [body: 'Closure'], doc: '')
}
if (enclosingCall("when")) {
method(name: 'allOf', type: 'java.lang.Object', params: [body: 'Closure'], doc: 'Execute the stage when all of the nested conditions are true. Must contain at least one condition')
method(name: 'anyOf', type: 'java.lang.Object', params: [body: 'Closure'], doc: 'Execute the stage when at least one of the nested conditions is true. Must contain at least one condition')
method(name: 'branch', type: 'java.lang.Object', params: [pattern: 'java.lang.Object'], doc: 'Execute the stage when the branch being built matches the branch pattern (ANT style path glob) given')
method(name: 'branch', type: 'java.lang.Object', namedParams: [parameter(name: 'pattern', type: 'java.lang.Object'), parameter(name: 'comparator', type: 'java.lang.Object'),], doc: 'Execute the stage when the branch being built matches the branch pattern (ANT style path glob) given')
method(name: 'environment', type: 'java.lang.Object', namedParams: [parameter(name: 'name', type: 'java.lang.String'), parameter(name: 'value', type: 'java.lang.String'),], doc: 'Execute the stage when the specified environment variable is set to the given value')
method(name: 'expression', type: 'boolean', params: [body: 'Closure'], doc: 'Execute the stage when the specified Groovy expression evaluates to true')
method(name: 'equals', type: 'boolean', params: [body: 'Closure'], doc: 'Execute the stage when the expected value is equal to the actual value')
method(name: 'equals', type: 'boolean', namedParams: [parameter(name: 'expected', type: 'java.lang.Object'), parameter(name: 'actual', type: 'java.lang.Object'),], doc: 'Execute the stage when the expected value is equal to the actual value')
method(name: 'not', type: 'boolean', params: [body: 'Closure'], doc: 'Execute the stage when the nested condition is false. Must contain one condition')
method(name: 'tag', type: 'java.lang.Object', params: [pattern: 'java.lang.Object'], doc: 'Execute the stage if the TAG_NAME variable matches the given pattern. Example: when { tag "release-*" }. If an empty pattern is provided the stage will execute if the TAG_NAME variable exists (same as buildingTag()).')
method(name: 'tag', type: 'java.lang.Object', namedParams: [parameter(name: 'pattern', type: 'java.lang.Object'), parameter(name: 'comparator', type: 'java.lang.Object'),], doc: 'Execute the stage if the TAG_NAME variable matches the given pattern. Example: when { tag "release-*" }. If an empty pattern is provided the stage will execute if the TAG_NAME variable exists (same as buildingTag()).')
method(name: 'triggeredBy', type: 'java.lang.Object', params: [cause: 'java.lang.Object'], doc: 'Execute the stage when the current build has been triggered by the param given')
method(name: 'triggeredBy', type: 'java.lang.Object', namedParams: [parameter(name: 'cause', type: 'java.lang.Object'), parameter(name: 'detail', type: 'java.lang.Object'),], doc: 'Execute the stage when the current build has been triggered by the param given')
}
// Only inside steps
if (enclosingCall("steps") || enclosingCall("always") || enclosingCall("success") ||
enclosingCall("failure") || enclosingCall("unstable") || enclosingCall("changed")) {
method(name: 'timestamp', type: 'java.lang.Object', params: [body: 'Closure'], doc: 'Timestamps')
method(name: 'bat', type: 'java.lang.Object', params: [script: 'java.lang.String'], doc: 'Windows Batch Script')
method(name: 'bat', type: 'java.lang.Object', namedParams: [parameter(name: 'script', type: 'java.lang.String'), parameter(name: 'encoding', type: 'java.lang.String'), parameter(name: 'returnStatus', type: 'java.lang.Boolean'), parameter(name: 'returnStdout', type: 'java.lang.Boolean'),], doc: 'Windows Batch Script')
method(name: 'checkout', type: 'java.lang.Object', params: [scm: 'java.util.Map'], doc: 'General SCM')
method(name: 'checkout', type: 'java.lang.Object', namedParams: [parameter(name: 'scm', type: 'java.util.Map'), parameter(name: 'changelog', type: 'java.lang.Boolean'), parameter(name: 'poll', type: 'java.lang.Boolean'),], doc: 'General SCM')
method(name: 'containerLog', type: 'java.lang.Object', params: [name: 'java.lang.String'], doc: 'Get container log from Kubernetes')
method(name: 'containerLog', type: 'java.lang.Object', namedParams: [parameter(name: 'name', type: 'java.lang.String'), parameter(name: 'limitBytes', type: 'int'), parameter(name: 'returnLog', type: 'java.lang.Boolean'), parameter(name: 'sinceSeconds', type: 'int'), parameter(name: 'tailingLines', type: 'int'),], doc: 'Get container log from Kubernetes')
method(name: 'deleteDir', type: 'java.lang.Object', params: [:], doc: 'Recursively delete the current directory from the workspace')
method(name: 'dir', type: 'java.lang.Object', params: [path: 'java.lang.String', body: 'Closure'], doc: 'Change current directory')
method(name: 'fileExists', type: 'java.lang.Object', params: [file: 'java.lang.String'], doc: 'Verify if file exists in workspace')
method(name: 'findFiles', type: 'java.lang.Object', params: [:], doc: 'Find files in the workspace')
method(name: 'findFiles', type: 'java.lang.Object', namedParams: [parameter(name: 'glob', type: 'java.lang.String'),], doc: 'Find files in the workspace')
method(name: 'git', type: 'java.lang.Object', params: [url: 'java.lang.Object'], doc: 'Git')
method(name: 'git', type: 'java.lang.Object', namedParams: [parameter(name: 'url', type: 'java.lang.Object'), parameter(name: 'branch', type: 'java.lang.Object'), parameter(name: 'changelog', type: 'java.lang.Boolean'), parameter(name: 'credentialsId', type: 'java.lang.Object'), parameter(name: 'poll', type: 'java.lang.Boolean'),], doc: 'Git')
method(name: 'junit', type: 'java.lang.Object', params: [testResults: 'java.lang.String'], doc: 'Archive JUnit-formatted test results')
method(name: 'junit', type: 'java.lang.Object', namedParams: [parameter(name: 'testResults', type: 'java.lang.String'), parameter(name: 'allowEmptyResults', type: 'java.lang.Boolean'), parameter(name: 'healthScaleFactor', type: 'double'), parameter(name: 'keepLongStdio', type: 'java.lang.Boolean'), parameter(name: 'testDataPublishers', type: 'java.util.Map'),], doc: 'Archive JUnit-formatted test results')
method(name: 'load', type: 'java.lang.Object', params: [path: 'java.lang.String'], doc: 'Evaluate a Groovy source file into the Pipeline script')
method(name: 'powershell', type: 'java.lang.Object', params: [script: 'java.lang.String'], doc: 'PowerShell Script')
method(name: 'powershell', type: 'java.lang.Object', namedParams: [parameter(name: 'script', type: 'java.lang.String'), parameter(name: 'encoding', type: 'java.lang.String'), parameter(name: 'returnStatus', type: 'java.lang.Boolean'), parameter(name: 'returnStdout', type: 'java.lang.Boolean'),], doc: 'PowerShell Script')
method(name: 'publishHTML', type: 'java.lang.Object', params: [target: 'java.util.Map'], doc: 'Publish HTML reports')
method(name: 'pwd', type: 'java.lang.Object', params: [:], doc: 'Determine current directory')
method(name: 'pwd', type: 'java.lang.Object', namedParams: [parameter(name: 'tmp', type: 'java.lang.Boolean'),], doc: 'Determine current directory')
method(name: 'readFile', type: 'java.lang.Object', params: [file: 'java.lang.String'], doc: 'Read file from workspace')
method(name: 'readFile', type: 'java.lang.Object', namedParams: [parameter(name: 'file', type: 'java.lang.String'), parameter(name: 'encoding', type: 'java.lang.String'),], doc: 'Read file from workspace')
method(name: 'readMavenPom', type: 'java.lang.Object', params: [:], doc: 'Read a maven project file.')
method(name: 'readMavenPom', type: 'java.lang.Object', namedParams: [parameter(name: 'file', type: 'java.lang.String'),], doc: 'Read a maven project file.')
method(name: 'sh', type: 'java.lang.Object', params: [script: 'java.lang.Object'], doc: 'Shell Script')
method(name: 'sh', type: 'java.lang.Object', namedParams: [parameter(name: 'script', type: 'java.lang.Object'), parameter(name: 'encoding', type: 'java.lang.String'), parameter(name: 'returnStatus', type: 'java.lang.Boolean'), parameter(name: 'returnStdout', type: 'java.lang.Boolean'),], doc: 'Shell Script')
method(name: 'sha1', type: 'java.lang.Object', params: [file: 'java.lang.String'], doc: 'Compute the SHA1 of a given file')
method(name: 'stash', type: 'java.lang.Object', params: [name: 'java.lang.String'], doc: 'Stash some files to be used later in the build')
method(name: 'stash', type: 'java.lang.Object', namedParams: [parameter(name: 'name', type: 'java.lang.String'), parameter(name: 'allowEmpty', type: 'java.lang.Boolean'), parameter(name: 'excludes', type: 'java.lang.String'), parameter(name: 'includes', type: 'java.lang.String'), parameter(name: 'useDefaultExcludes', type: 'java.lang.Boolean'),], doc: 'Stash some files to be used later in the build')
method(name: 'step', type: 'java.lang.Object', params: [delegate: 'java.util.Map'], doc: 'General Build Step')
method(name: 'svn', type: 'java.lang.Object', params: [url: 'java.lang.String'], doc: 'Subversion')
method(name: 'svn', type: 'java.lang.Object', namedParams: [parameter(name: 'url', type: 'java.lang.String'), parameter(name: 'changelog', type: 'java.lang.Boolean'), parameter(name: 'poll', type: 'java.lang.Boolean'),], doc: 'Subversion')
method(name: 'tee', type: 'java.lang.Object', params: [file: 'java.lang.String', body: 'Closure'], doc: 'Tee output to file')
method(name: 'tm', type: 'java.lang.Object', params: [stringWithMacro: 'java.lang.String'], doc: 'Expand a string containing macros')
method(name: 'touch', type: 'java.lang.Object', params: [file: 'java.lang.String'], doc: 'Create a file (if not already exist) in the workspace, and set the timestamp')
method(name: 'touch', type: 'java.lang.Object', namedParams: [parameter(name: 'file', type: 'java.lang.String'), parameter(name: 'timestamp', type: 'java.lang.Long'),], doc: 'Create a file (if not already exist) in the workspace, and set the timestamp')
method(name: 'unstash', type: 'java.lang.Object', params: [name: 'java.lang.String'], doc: 'Restore files previously stashed')
method(name: 'unzip', type: 'java.lang.Object', params: [zipFile: 'java.lang.String'], doc: 'Extract Zip file')
method(name: 'unzip', type: 'java.lang.Object', namedParams: [parameter(name: 'zipFile', type: 'java.lang.String'), parameter(name: 'charset', type: 'java.lang.String'), parameter(name: 'dir', type: 'java.lang.String'), parameter(name: 'glob', type: 'java.lang.String'), parameter(name: 'quiet', type: 'java.lang.Boolean'), parameter(name: 'read', type: 'java.lang.Boolean'), parameter(name: 'test', type: 'java.lang.Boolean'),], doc: 'Extract Zip file')
method(name: 'validateDeclarativePipeline', type: 'java.lang.Object', params: [path: 'java.lang.String'], doc: 'Validate a file containing a Declarative Pipeline')
method(name: 'wrap', type: 'java.lang.Object', params: [delegate: 'java.util.Map', body: 'Closure'], doc: 'General Build Wrapper')
method(name: 'writeFile', type: 'java.lang.Object', namedParams: [parameter(name: 'file', type: 'java.lang.String'), parameter(name: 'text', type: 'java.lang.String'), parameter(name: 'encoding', type: 'java.lang.String'),], doc: 'Write file to workspace')
method(name: 'writeJSON', type: 'java.lang.Object', namedParams: [parameter(name: 'file', type: 'java.lang.String'), parameter(name: 'json', type: 'java.util.Map'), parameter(name: 'pretty', type: 'int'),], doc: 'Write JSON to a file in the workspace.')
method(name: 'writeMavenPom', type: 'java.lang.Object', params: [model: 'java.util.Map'], doc: 'Write a maven project file.')
method(name: 'writeMavenPom', type: 'java.lang.Object', namedParams: [parameter(name: 'model', type: 'java.util.Map'), parameter(name: 'file', type: 'java.lang.String'),], doc: 'Write a maven project file.')
method(name: 'writeYaml', type: 'java.lang.Object', namedParams: [parameter(name: 'file', type: 'java.lang.String'), parameter(name: 'data', type: 'java.lang.Object'), parameter(name: 'charset', type: 'java.lang.String'),], doc: 'Write a yaml from an object.')
method(name: 'zip', type: 'java.lang.Object', params: [zipFile: 'java.lang.String'], doc: 'Create Zip file')
method(name: 'zip', type: 'java.lang.Object', namedParams: [parameter(name: 'zipFile', type: 'java.lang.String'), parameter(name: 'archive', type: 'java.lang.Boolean'), parameter(name: 'dir', type: 'java.lang.String'), parameter(name: 'glob', type: 'java.lang.String'),], doc: 'Create Zip file')
method(name: 'archive', type: 'java.lang.Object', params: [includes: 'java.lang.String'], doc: 'Advanced/Deprecated Archive artifacts')
method(name: 'archive', type: 'java.lang.Object', namedParams: [parameter(name: 'includes', type: 'java.lang.String'), parameter(name: 'excludes', type: 'java.lang.String'),], doc: 'Archive artifacts')
method(name: 'container', type: 'java.lang.Object', params: [name: 'java.lang.String', body: 'Closure'], doc: 'Advanced/Deprecated Run build steps in a container')
method(name: 'container', type: 'java.lang.Object', params: [body: 'Closure'], namedParams: [parameter(name: 'name', type: 'java.lang.String'), parameter(name: 'shell', type: 'java.lang.String'),], doc: 'Run build steps in a container')
method(name: 'dockerFingerprintFrom', type: 'java.lang.Object', namedParams: [parameter(name: 'dockerfile', type: 'java.lang.String'), parameter(name: 'image', type: 'java.lang.String'), parameter(name: 'buildArgs', type: 'java.util.Map'), parameter(name: 'toolName', type: 'java.lang.String'),], doc: 'Record trace of a Docker image used in FROM')
method(name: 'unarchive', type: 'java.lang.Object', params: [:], doc: 'Advanced/Deprecated Copy archived artifacts into the workspace')
method(name: 'unarchive', type: 'java.lang.Object', namedParams: [parameter(name: 'mapping', type: 'java.util.Map'),], doc: 'Copy archived artifacts into the workspace')
method(name: 'withDockerContainer', type: 'java.lang.Object', params: [image: 'java.lang.String', body: 'Closure'], doc: 'Advanced/Deprecated Run build steps inside a Docker container')
method(name: 'withDockerContainer', type: 'java.lang.Object', params: [body: 'Closure'], namedParams: [parameter(name: 'image', type: 'java.lang.String'), parameter(name: 'args', type: 'java.lang.String'), parameter(name: 'toolName', type: 'java.lang.String'),], doc: 'Run build steps inside a Docker container')
method(name: 'withDockerRegistry', type: 'java.lang.Object', params: [registry: 'java.util.Map', body: 'Closure'], doc: 'Advanced/Deprecated Sets up Docker registry endpoint')
method(name: 'withDockerServer', type: 'java.lang.Object', params: [server: 'java.util.Map', body: 'Closure'], doc: 'Advanced/Deprecated Sets up Docker server endpoint')
method(name: 'parallel', type: 'java.lang.Object', params: [body: 'java.util.Map'], doc: 'Run task in parallel')
method(name: 'usernamePassword', type: 'java.lang.Object', params: [stages: Map], doc: 'username plus password credential type')
method(name: 'usernamePassword', type: 'java.lang.Object', namedParams: [parameter(name: 'credentialsId', type: 'java.lang.String'), parameter(name: 'passwordVariable', type: 'java.lang.String'), parameter(name: 'usernameVariable', type: 'java.lang.String'),], doc: 'username plus password credential type')
}
// Post actions!
if (enclosingCall("post")) {
method(name: 'always', type: 'java.lang.Object', params: [body: 'Closure'])
method(name: 'success', type: 'java.lang.Object', params: [body: 'Closure'])
method(name: 'failure', type: 'java.lang.Object', params: [body: 'Closure'])
method(name: 'unstable', type: 'java.lang.Object', params: [body: 'Closure'])
method(name: 'changed', type: 'java.lang.Object', params: [body: 'Closure'])
}
}
def openShiftVar = context(ctype: 'com.openshift.jenkins.plugins.pipeline.OpenShiftGlobalVariable')
// Unless otherwise specified, operations must be performed within a withCluster closure
// Exceptions include openshift.logLevel, openshift.verbose, and openshift.selector
// withCluster may not be contained within a withProject or withCredentials closure
contributor(openShiftVar) {
def withCluster_doc = '''
<p>Declares that OpenShift operations within the closure body should be executed against the specified clusterName. The statement also implicitly acts as both a openshift.withProject (establishing the default project within the closure) and openshift.withCredentials (establishing the default authorization token within the closure). </p>
<br><p><b>withCluster</b> may not be contained within a openshift.withProject or openshift.withCredentials closure. </p>
<br><p>When withCluster closures are nested within each other, OpenShift operations will use the clusterName information associated with the most tightly scoped occurrence.</p>'''
def withCredentials_doc = '''<p>Specifies that OpenShift operations within the closure body should use the identified credential. The return value is the value returned by (or the value of the last statement within) the closure.</p>
<br><p>When withCredentials closures are nested, OpenShift operations will use the credential information associated with the most tightly scoped occurrence.</p>
<br><p>If no credential information is found within a given scope, it is assumed that Jenkins is running within an OpenShift Pod. An attempt will be made to read a token from the Jenkins master filesystem at <b>/run/secrets/kubernetes.io/serviceaccount/token</b>. </p>'''
def withProject_doc = '''<p>Specifies that OpenShift operations within the closure body should target the identified project. The return value is the value returned by (or the value of the last statement within) the closure.</p>
<br><p>When withProject closures are nested, OpenShift operations will use the project information associated with the most tightly scoped occurrence.</p>
<br><p>If no project information is found within a given scope, it is assumed that Jenkins is running within an OpenShift Pod. An attempt will be made to read the current project from the Jenkins master filesystem at <b>/run/secrets/kubernetes.io/serviceaccount/project</b>.</p>'''
def selector_doc = '''<p>selector has multiple variations:</p>
<ul><ul>
<li>openshift.selector(kind:String):DynamicSelector</li>
&nbsp;&nbsp;&nbsp;&nbsp;Example: openshift.selector("nodes")
<br><br><li>openshift.selector(kind:String,labels:Map):DynamicSelector</li>
&nbsp;&nbsp;&nbsp;&nbsp;Example: openshift.selector("pod", [ alabel : "avalue", l2: "v2" ])
<br><br><li>openshift.selector(kind:String,name:String):StaticSelector</li>
&nbsp;&nbsp;&nbsp;&nbsp;Example: openshift.selector("dc", "frontend")
<br><br><li>openshift.selector(qualifiedName:String):StaticSelector</li>
&nbsp;&nbsp;&nbsp;&nbsp;Example: openshift.selector("dc/mysql")
<br><br><li>openshift.selector(names:List):StaticSelector</li>
&nbsp;&nbsp;&nbsp;&nbsp;Example: openshift.selector([ "dc/jenkins", "build/ruby1" ])
</ul></ul>
<p><b>Context:</b> Does not need to be contained within openshift.withCluster.</p>
<br><p>Creates a Selector object (either a DynamicSelector or a StaticSelector depending on the invocation) which can be stored away in a variable or used inline within the DSL. The creation of a Selector does not perform any immediate operation on an OpenShift clusterName -- it merely describes a grouping of objects which can be subsequently be acted on by methods exposed by the Selector object.</p>
<br><p>Operations performed using a given Selector will be relative to the context in which those operations are encountered. That is, the context of surrounding openshift.withCluster, openshift.withProject, openshift.withCredentials closures. For example, a Selector can be established once and subsequently used within a variety of openshift.withCluster closures. Each time a method is invoked on the Selector, the clusterName affected will differ depending on the openshift.withCluster which contains the invocation. </p>'''
def process_doc = '''<p>process has multiple variations:</p>
<ul><ul>
<li>openshift.process(json:String, [args...:String]):List</li>
&nbsp;&nbsp;&nbsp;&nbsp;Example: openshift.process("{ \\"metadata\\": ... }", "-p", "PARAM=VALUE")<br>
&nbsp;&nbsp;&nbsp;&nbsp;Example: openshift.process(readFile(file:'template.json'), "-p", "PARAM=VALUE")
<br><br><li>openshift.process(obj:Map, [args...:String]):List</li>
&nbsp;&nbsp;&nbsp;&nbsp;Example: openshift.process([ metadata: [... ] ],"-p", "PARAM=VALUE")
<br><br><li>openshift.process(templateName:String, [args...:String]):List</li>
&nbsp;&nbsp;&nbsp;&nbsp;Example: openshift.process("openshift//foo","-p=PARAM=VALUE")
</ul></ul>
<p>Processes an OpenShift template, using any specified parameter values, and returns a Groovy List where each element models an object which results from processing the template. The List can subsequently be passed to openshift.create, openshift.replace, openshift.apply, or openshift.delete.</p>
<ul><ul>
<li><b>json</b> - A literal string containing JSON to process.</li>
<br><li><b>obj</b> - A Groovy map which models an OpenShift template.</li>
<br><li><b>templateName</b> - The name of a template object stored in OpenShift.</li>
<br><li><b>args...</b> - Arguments that will be passed verbatim to the OpenShift process facility.</li>
</ul></ul>'''
def delete_doc = '''<ul><ul>
<li><b>args...</b> - A list of arguments which will be sent verbatim to the OpenShift tool.</li>
&nbsp;&nbsp;&nbsp;&nbsp;Example: openshift.delete("configmap/foo", "configmap/bar")
<br><br><li><b>args...</b> - A Groovy Map with models enough of the object such that the OpenShift command-line-interface can delete it. </li>
&nbsp;&nbsp;&nbsp;&nbsp;Example: openshift.delete([ kind : "DeploymentConfig", metadata: [ ... ], ... ])
<br><br><li><b>args...</b> - JSON or YAML which represents enough of the object such that the OpenShift command-line-interface can delete it. </li>
&nbsp;&nbsp;&nbsp;&nbsp;Example: openshift.delete("{ \\"metadata\\" : { ... } ... ")
<br><br><li><b>args...</b> - A List of Groovy Map objects which model enough of the object such that the OpenShift command-line-interface can delete it. </li>
&nbsp;&nbsp;&nbsp;&nbsp;Example: openshift.delete([ objModel1, objModel1, ... ])
</ul></ul>
<p>The delete operation is a bit of a combination of the passthrough commands noted above, where each parameter will be passed verbatim to the command line utility, returning a result. But it can also treat the first parameter as a Groovy map, List of Groovy maps, or JSON/YAML string, similar to openshift.create, but the difference being it does not return a StaticSelector. It just returns the Result from the delete operation performed by the OpenShift command-line-interface.</p>'''
def raw_doc = '''<p>Allows caller to specify virtually any OpenShift command to execute. Server, project, and token information will be added automatically by the plugin if they are not specified by the caller.</p>
<br><p>An exception will be thrown if the command does not return zero for an exit status. The Result object returned will make available the stdout and stderr for the operation. </p>'''
method(name: 'withCluster', type: 'java.lang.Object', params: [body: 'Closure'], doc: withCluster_doc)
method(name: 'withCluster', type: 'java.lang.Object', params: [clusterName: 'java.lang.Object', body: 'Closure'], doc: withCluster_doc)
method(name: 'withCluster', type: 'java.lang.Object', params: [clusterName: 'java.lang.Object', credential: 'java.lang.Object', body: 'Closure'], doc: withCluster_doc)
method(name: 'setLockName', type: 'void', params: [lock_name: 'java.lang.String'], doc: 'Protects the bodies of any `withCluster`, `withProject`, or `withCredentials` closures from running in parallel. Call prior to the first `openshift.withCluster` invocation.<br><br>Call prior to the first `openshift.withCluster` invocation.')
method(name: 'selector', type: 'java.lang.Object', doc: selector_doc)
method(name: 'selector', type: 'java.lang.Object', params: [kind: 'java.lang.Object'], doc: selector_doc)
method(name: 'selector', type: 'java.lang.Object', params: [kind: 'java.lang.Object', qualifier: 'java.lang.Object'], doc: selector_doc)
method(name: 'selector', type: 'java.lang.Object', params: [names: 'java.util.List'], doc: selector_doc)
method(name: 'logLevel', type: 'void', params: [level: 'int'], doc: 'Sets the logging level for all OpenShift operations subsequently executed')
method(name: 'loglevel', type: 'void', params: [level: 'int'], doc: 'Sets the logging level for all OpenShift operations subsequently executed')
method(name: 'verbose', type: 'void', doc: 'Equivalent to loglevel(8)')
method(name: 'verbose', type: 'void', params: [enable: 'java.lang.Boolean'], doc: 'If true, equivalent to loglevel(8), otherwise loglevel(0)')
if (enclosingCall("withCluster") || enclosingCall("withProject") || enclosingCall("withCredentials")) {
method(name: 'cluster', type: 'java.lang.String', doc: 'Returns the url of the currently scoped cluster')
method(name: 'skipTLSVerify', type: 'boolean', doc: 'Returns true if SkipTLSVerify is set for the server connection, false otherwise')
method(name: 'withCredentials', type: 'java.lang.Object', params: [body: 'Closure'], doc: withCredentials_doc)
method(name: 'withCredentials', type: 'java.lang.Object', params: [credential: 'java.lang.Object', body: 'Closure'], doc: withCredentials_doc)
method(name: 'withProject', type: 'java.lang.Object', params: [body: 'Closure'], doc: withProject_doc)
method(name: 'withProject', type: 'java.lang.Object', params: [projectName: 'java.lang.Object', body: 'Closure'], doc: withProject_doc)
method(name: 'project', type: 'java.lang.String', doc: 'Returns the name of the currently scoped project')
method(name: 'verifyService', type: 'java.lang.Boolean', params: [svc_name: 'java.lang.String'], doc: 'Allows you to check if your Openshift service is reachable or not. This works with headless Services (with Selectors) as well as normal Services with ClusterIP which are in the namespace specified by the openshift.withProject().')
method(name: 'create', type: 'java.lang.Object', params: [obj: 'java.lang.Object', args: 'Object[]'], doc:'Requests OpenShift to create a new object. The object may be defined using a Groovy map or as a String containing JSON or YAML. The method returns a StaticSelector containing the names of the objects created.')
method(name: 'replace', type: 'java.lang.Object', params: [obj: 'java.lang.Object', args: 'Object[]'], doc:'Requests OpenShift to replace a new object. The object may be defined using a Groovy map or as a String containing JSON or YAML. The method returns a StaticSelector containing the names of the objects created.')
method(name: 'apply', type: 'java.lang.Object', params: [obj: 'java.lang.Object', args: 'Object[]'], doc:'Requests OpenShift to apply a new object. The object may be defined using a Groovy map or as a String containing JSON or YAML. The method returns a StaticSelector containing the names of the objects created/modified.')
method(name: 'process', type: 'java.util.List', params: [obj: 'java.lang.Object', args: 'Object[]'], doc:process_doc)
method(name: 'patch', type: 'java.lang.Object', params: [obj: 'java.lang.String', patch: 'java.lang.String', args: 'String[]'], doc:'Update field(s) of a resource using strategic merge patch, JSON and YAML formats are accepted. The patch must be surrounded by escaped quotes, either single or double, depending on what type of quotes you used to surround your field names and data.')
method(name: 'newProject', type: 'java.lang.Object', params: [name: 'java.lang.Object', args: 'Object[]'], doc:'Creates a new OpenShift project. ')
method(name: 'newApp', type: 'java.lang.Object', params: [args: 'String[]'], doc: 'Invokes the OpenShift new-app facility. The Selector returned identifies the objects created by the request.')
method(name: 'newBuild', type: 'java.lang.Object', params: [args: 'String[]'], doc: 'Invokes the OpenShift new-build facility. The Selector returned identifies the objects created by the request.')
method(name: 'startBuild', type: 'java.lang.Object', params: [args: 'String[]'], doc: 'Invokes the OpenShift start-build facility allowing the caller to specify command line arguments. This invocation differs from the Selector.startBuild method as the caller to this method must supply the BuildConfig name, if any. <br><br>The Selector returned identifies the objects created by the request.')
method(name: 'exec', type: 'java.lang.Object', params: [args: 'String[]'], doc: '')
method(name: 'idle', type: 'java.lang.Object', params: [args: 'String[]'], doc: '')
method(name: '_import', type: 'java.lang.Object', params: [args: 'String[]'], doc: '')
method(name: 'policy', type: 'java.lang.Object', params: [args: 'String[]'], doc: '')
method(name: 'run', type: 'java.lang.Object', params: [args: 'String[]'], doc: '')
method(name: 'rsh', type: 'java.lang.Object', params: [args: 'String[]'], doc: '')
method(name: 'rsync', type: 'java.lang.Object', params: [args: 'String[]'], doc: '')
method(name: 'secrets', type: 'java.lang.Object', params: [args: 'String[]'], doc: '')
method(name: 'set', type: 'java.lang.Object', params: [args: 'String[]'], doc: '')
method(name: 'tag', type: 'java.lang.Object', params: [args: 'String[]'], doc: '')
method(name: 'expose', type: 'java.lang.Object', params: [args: 'String[]'], doc: '')
method(name: 'delete', type: 'java.lang.Object', params: [obj: 'java.lang.Object', args: 'String[]'], doc: delete_doc)
method(name: 'raw', type: 'java.lang.Object', params: [args: 'String[]'], doc: raw_doc)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment