Get the build log
With Build Management API, you can retrieve a sequence of events that happened during the build execution to:
- Understand the build progress and build failures.
- Perform audit on finished builds.
You can get build logs for both running and finished builds. Logs for running builds can change and will grow as the build progresses. Logs for finished builds don't change.
You can get build logs by using the following parameters:
Sample requests in this guide include the following path parameters:
| Parameter name | Description |
|---|---|
tenantId | Tenant ID. |
starId | ID of a star. |
applicationName | Name of an application. |
buildType | Type of builds that are available for a given application. You can use the following values for respective applications: - Extension Layer (EA): Alpine_Build, Alpine_Install, Alpine_ServerTests - InsuranceSuite: IS_Test, IS_StaticAnalysis, IS_UpdatabilityCheck, IS_SmokeTests, IS_BehaviorTests, IS_Build, IS_ApiTests, IS_Dockerize, IS_Sentinel, IS_VerifyBlueGreen, IS_BuildSolr, IS_DockerizeSolr, IS_SecureTokenVerification - Guidewire Testing Framework: GT_LoadTests, GT_FrameworkUiTests, GT_ApiTests, GT_FrameworkTests - Jutro Digital Platform: Jutro_Test, Jutro_BuildAndDockerize, Jutro_UpgradeJutroCore, Jutro_WebVitals, Jutro_E2ETests - EnterpriseEngage: Portals_Test, Portals_Build, Portals_Deploy, Portals_Undeploy - Shared Packages: Shared_CodeStandardsVerifier, Shared_Publish, Shared_Test, Shared_UpgradeJutro |
buildNumber | Number of the build for which you want to get details or artifacts. |
buildId | Unique identifier within the CI/CD server instance that is automatically assigned to each build. |
Get the build log by build ID
To get the build log, you need to have a build ID. You can get the build ID in one of the following ways:
- By checking a list of available builds.
- From the response, after running a build.
To get the build log by the build ID, send the following GET request:
curl -X 'GET' \
{baseURL}/api/v1/tenants/{tenantId}/stars/{starId}/builds/{buildId}/log'\
-H 'accept: text/plain'
-H 'Authorization: Bearer {access_token}'
A response contains the UTF-8 encoded plain text build log:
[15:06:37] : Collecting changes in 2 VCS roots
[15:06:38] : Checkout directory: /opt/buildagent/work/3d3cc786ffccf45
[15:08:12] : Build preparation done
[15:08:12]W: Step 1/3: Reset Placeholder Parameters (Command Line)
[15:08:12] : [Step 1/3] Starting: /opt/buildagent/temp/agentTmp/custom_script.sh
[15:08:12] : [Step 1/3] in directory: /opt/buildagent/work/3d3cc786ffccf45
[15:08:12] : [Step 1/3] Process exited with code 0
[15:08:12]W: Step 2/3: Build Application (Command Line) (1m:15s)
[15:08:12] : [Step 2/3] Starting: /usr/bin/gradle clean build
[15:08:25] : [Step 2/3] BUILD SUCCESSFUL in 13s
[15:09:27] : [Step 2/3] Process exited with code 0
[15:09:27]W: Step 3/3: Publish Artifacts (Command Line)
[15:09:27] : [Step 3/3] Starting: /opt/buildagent/temp/agentTmp/publish_artifacts.sh
[15:09:35] : [Step 3/3] Process exited with code 0
[15:09:37] : Publishing artifacts
[15:09:41] : Build finished
Lines are separated by the \n newline characters. The content might be empty if no log entries are available.
Get the build log by the build number
To get the build log, you need to have a build number. You can get the build number by checking a list of available builds.
To get the build log by the build number, send the following GET request:
curl -X 'GET' \
{baseURL}/api/v1/tenants/{tenantId}/stars/{starId}/applications/{applicationName}/build-types/{buildType}/builds/{buildNumber}/log'\
-H 'accept: text/plain'
-H 'Authorization: Bearer {access_token}'
A response contains the UTF-8 encoded plain text build log:
[15:06:37] : Collecting changes in 2 VCS roots
[15:06:38] : Checkout directory: /opt/buildagent/work/3d3cc786ffccf45
[15:08:12] : Build preparation done
[15:08:12]W: Step 1/3: Reset Placeholder Parameters (Command Line)
[15:08:12] : [Step 1/3] Starting: /opt/buildagent/temp/agentTmp/custom_script.sh
[15:08:12] : [Step 1/3] in directory: /opt/buildagent/work/3d3cc786ffccf45
[15:08:12] : [Step 1/3] Process exited with code 0
[15:08:12]W: Step 2/3: Build Application (Command Line) (1m:15s)
[15:08:12] : [Step 2/3] Starting: /usr/bin/gradle clean build
[15:08:25] : [Step 2/3] BUILD SUCCESSFUL in 13s
[15:09:27] : [Step 2/3] Process exited with code 0
[15:09:27]W: Step 3/3: Publish Artifacts (Command Line)
[15:09:27] : [Step 3/3] Starting: /opt/buildagent/temp/agentTmp/publish_artifacts.sh
[15:09:35] : [Step 3/3] Process exited with code 0
[15:09:37] : Publishing artifacts
[15:09:41] : Build finished
Lines are separated by the \n newline characters. The content might be empty if no log entries are available.