title: Process Configuration Details - CODING Help Center
pageTitle: Process Configuration Details
pagePrevTitle: Text Editor
pagePrev: ci/process/text.html
pageNextTitle: Graphical Editor
pageNext: ci/process/visual-editor.html
alias: process/detail.html
This document provides you a guidance on compiling a build process and describes parameters in each step.
Checks out source code from a Git repository in the current project. This command is a simpler version of the checkout command.
Parameter list:
url
: stringbranch
: stringchangelog
: stringcredentialsId
: stringpoll
: booleanUniversally checks out SCM code (Git or SVN).
This step returns content in a map format. If you are using Git, you could use the following:
def scmVars = checkout scm
def commitHash = scmVars.GIT_COMMIT
// or
def commitHash = checkout(scm).GIT_COMMIT
The parameter scm is an object that allows the SCM type to be configured, such as the following:
GitSCM example:
checkout([$class: 'GitSCM', branches: [[name: env.GIT_BUILD_REF]],
userRemoteConfigs: [[url: env.GIT_REPO_URL]]])
userRemoteConfigs parameter list:
url
: string
name
: string, name of a remote repository such as "origin"
refspec
: string, for more information, see Git Internals - The Refspec.
branches
: array of objects (optional)
changelog
: boolean (optional)
credentialsId
: string (optional)
doGenerateSubmoduleConfigurations
: boolean (optional)
submoduleCfg
: array (optional)
SubversionSCM: Checks out code from an SVN server. Example:
checkout([$class: 'SubversionSCM', remote: 'http://sv-server/repository/trunk']]])
Parameter list:
locations
: array of objectsremote
: stringcredentialsId
: stringlocal
: string, specifies a local directory (relative to the workspace) as the location of code to be checked outdepthOption
: string. Corresponds to --depth. The default value is unlimited. Learn More.ignoreExternalsOption
: booleanParameter list:
label
: string, environment label name such as java-8Collects build results (such as jar, war, or apk). Note that the artifacts collected are saved and deleted along with the build history. This is just a temporary storage space. We recommend using "Artifact Management" for version management of build results.
Parameter list:
artifacts
: string, you can use the wildcard * to specify the path pattern of files in the workspace to be collected while keeping to the Apache Ant Path RulesallowEmptyArchive
: boolean (optional). Generally, this command results in "Building Failed" if no file appropriate to the collection pattern is found. If this parameter is set to "true", a build process returns a warning if there are no artifacts, instead of a failure result.caseSensitive
: boolean (optional). By default, file path rules are case-sensitive. If this parameter is set to "false", the rules are non-case-sensitive.defaultExcludes
: boolean (optional)excludes
: boolean (optional), you can exclude certain files when setting the path pattern while keeping to the Apache Ant Path Rulesfingerprint
: boolean (optional), file hashes are also calculated during collectiononlyIfSuccessful
: boolean (optional), only collected when "Build successful" is returnedExecutes a shell script.
Example:
pipeline {
agent any
stages {
stage('Example') {
steps {
echo 'Hello World'
sh 'ls -al'
}
}
}
}
Collects JUnit and TestNG test reports (in XML). You can specify the XML files to be collected using **/build/test-reports/*.xml
, for example. Do not include XML files that are not reports. You can use commas to separate multiple rules.
Parameter list:
testResults
: stringallowEmptyResults
: boolean (optional), "file does not exist" or "file is empty" is allowedkeepLongStdio
: boolean (optional), all test logs, including those of passed test cases, are keptChanges directory substeps. You can fill in some substeps in the "dir" block, which will be run in the specified directory path.
Parameter list:
path
: stringPauses for a period of time until the set due time. Similar to sleep xxx
in Unix.
Parameter list:
time
: intunit
: Select one from NANOSECONDS, MICROSECONDS, MILLISECONDS, SECONDS, MINUTES, HOURS, and DAYS
.Sends an error signal. Used when you need to partially terminate an execution process. You can also use throw new Exception(), but the exception stack printed is shorter if you use "error".
Parameter list:
message
: stringReturns the current directory path as a string.
Parameter list:
tmp
: boolean (optional). This parameter returns a temporary directory associated with the workspace. Generally, it is used when you need to store some temporary files without confusing the workspace directory.Writes the specified content into a file.
Parameter list:
file
: stringtext
: stringencoding
: string. File encoding. If left empty, the default encoding in the current run environment is used. In the case of a binary file, a base-64-encoded result is returned.Reads a file from a relative path and returns the file content as a string.
Parameter list:
file
: string, path address relative to the workspace directoryRetries the specified block until the set maximum number of retries is reached. Stops retrying if the execution process ends normally. Keeps retrying until the set maximum number of retries is reached if an exception occurs in the execution process. The build process terminates if an exception occurs during the last try.
Parameter list:
count
: intExecutes the process in a block within a limited time. When the time is up, the exception org.jenkinsci.plugins.workflow.steps.FlowInterruptedException
is returned. The optional unit parameter is minutes by default.
Parameter list:
time
: intactivity
: boolean. Time is calculated when there is no new content in the log rather than based on an absolute execution time.unit
: Select one from NANOSECONDS, MICROSECONDS, MILLISECONDS, SECONDS, MINUTES, HOURS, and DAYS
.Catches errors in the specified substep.
Records the execution time of the specified substep in the form of a Unix timestamp.
Loops the execution of the specified substep for the designated number of times.
Loops the execution of the specified substep until the substep returns "true".
Prints information in the log.
Parameter list:
message
: stringRuns an arbitrary pipeline script.
Runs a Groovy source file in this location during the build process.
Example:
pipeline {
agent any
stages {
stage('Example') {
steps {
echo 'Hello World'
load 'test.groovy'
}
}
}
}
Runs a yarn audit in the specified directory. In Continuous Integration, you can see the vulnerabilities found during the yarn dependency audit on the results page.
Parameter list:
directory
: string (optional). Fill in the directory location of yarn.lock. Runs in the root directory of the project by default.collectResult
: boolean (optional). Collects yarn audit reports.Runs an npm audit in the specified directory. In Continuous Integration, you can see the vulnerabilities found during the npm dependency audit on the results page.
Parameter list:
directory
: string (optional). Fill in the directory location of package.json. Runs in the root directory of the project by default.collectResult
: boolean (optional). Collects npm audit reports.Merges code. You can merge the specified merge request.
Parameter list:
token
: string, project tokendepot
: string, repository namemrResourceId
: string, specified resource IDcommitMessage
: string, merged commit message templatedeleteSourceBranch
: boolean (optional), deletes source branchfastForward
: boolean (optional), tries fast-forward mergeComments on a merge request. You can comment on a specified merge request.
Parameter list:
token
: string, project tokendepot
: string, repository namemrResourceId
: string, specified resource IDcommentContent
: string, comment template==== 2020/08/13 ====
Was this page helpful?