In my Jenkins build job I pull java code from Gitlab and build on Jenkins using Ant build script (build.xml). A .zip file outcome of the build.
I am trying to upload build artifacts (zip file) to Dimensions CM using Dimensions plugin for Jenkins using 'load any build artifacts to dimensions' as a post build action. Dimension is rejecting the artifact due to lack of the request id for it attach this artifact in Dimensions.
The plugin documentation says to "If you wish to specify a request to save these changes against, then you should set a project default request using SCWS or use DM_TARGET_REQUEST"
I am getting this error:
START =======
Started by user Ahmad, Ershad
[EnvInject] - Loading node environment variables.
Building on master in workspace /opt/wss/stg/jenkins/DimensionsUpload1
[DIMENSIONS] Calculating changes for directory 'DM_TARGET_REQUEST=PCMTPROJPROJ_SMR_82'...
[DimensionsUpload1] $ /bin/sh -xe /opt/wss/stg/apache-tomcat-6.0.43/temp/hudson7507543782532160733.sh
+ cd /opt/wss/stg/jenkins/DimensionsUpload1
+ ls -ltr
total 138484
-rw-r-----. 1 webdev webdev 141800254 Feb 16 08:11 BuildArtifact.1.0.zip
[DIMENSIONS] Running checkin on master...
[DIMENSIONS] Running build in '/opt/wss/stg/jenkins/DimensionsUpload1'...
[DIMENSIONS] Scanning workspace for files to be saved into Dimensions...
[DIMENSIONS] Running Ant pattern scanner...
[DIMENSIONS] Found 1 file(s) to check in...
[DIMENSIONS] Loading files into Dimensions project "PCMTPROJ:RELSTREAM"...
FATAL: Unable to run checkin callout (DimensionsRuntimeException: Upload files (DimensionsRuntimeException: Dimensions command 'UPLOAD /USER_FILELIST="/opt/wss/stg/apache-tomcat-6.0.43/temp/dmCm15188000765706781907912904279764.tmp" /WORKSET="PCMTPROJ:RELSTREAM" /COMMENT="Build artifacts delivered by Jenkins for job 'DEVOPS_PCMTPROJ_DmUpload' - build 68" /USER_DIRECTORY="/opt/wss/stg/jenkins/DimensionsUpload1"' failed (DimensionsRuntimeException: Using Project 'PCMTPROJ:RELSTREAM'. Using '/opt/wss/stg/jenkins/DimensionsUpload1/' as the Project work area.
Scanning repository: 0.00 sec
Scanning local work area: 0.00 sec
Creating new item revision for '/opt/wss/stg/jenkins/DimensionsUpload1/BuildArtifact.1.0.zip'
COR0005162E Error: To create a new Item revision of type PROD_CODE you must specify a valid request
COR0006384E Error: Failed to create Item for '/opt/wss/stg/jenkins/DimensionsUpload1/BuildArtifact.1.0.zip'
Warning: There were errors while uploading files from the specified network node. Please check the upload log.
Updating files: 2.57 sec
Uploading Project: 2.58 sec
)))
Build step 'Load any build artifacts into the Dimensions repository' changed build result to FAILURE
Build step 'Load any build artifacts into the Dimensions repository' marked build as failure
Finished: FAILURE
=======END
I have tried using the export command in shell but it doesn't work:
cd /opt/wss/stg/jenkins/DimensionsUpload1
ls -ltr
export $ITEM_TYPE PROD_CODE
export $DM_TARGET_REQUEST PCM_SMR_82
I was able to resolve this using the below option
Click on configure in your build job
[Check box] This build is parameterized (see pic below)