Xl Release Create Xl Deploy Configuration Item

Hi there:
we are using XL Release task: ‘XL Deploy CI - Create CI’ to create configuration item, we would like create a shell script, so that’s why specify ‘CI ID’ with ‘Applications/test/test/3.5/scripts’ and ‘CI Type’ with ‘script.Script’.

I understand we need specify ‘XML Descriptor’ as well, due to without it, it will prompt error:

Exception during execution:
javax.script.ScriptException: Exception: Failed to create ci [Applications/test/test/3.5/scripts]. Server return [500], with content [Artifacts need to have either a fileUri set or an uploaded file] in at line number 3

Seems like need specify fileUri in ‘XML Descriptor’.

So would like to know:

  1. how to specify fileUri in ‘XML Descriptor’
  2. due to this is shell script, can I upload into XL release template property as attachment and refer it in ‘XML Descriptor’?

Thanks!

there are other ways, but a simple way to get an example of an xml descriptor of a ci is to use the rest api’s repository service to browse to the ci in question and it will return the descriptor for that ci. for example, in my browser if i go to - http://localhost:4516/deployit/repository/ci/Applications/AdamTestSpace/zd671/1/test, i get this back -

<file.File id="Applications/AdamTestSpace/zd671/1/test" token="45ebaebd-f2c2-406c-bedf-a3e0b96db491" created-by="admin" created-at="2021-11-29T23:43:22.152+0000" last-modified-by="admin" last-modified-at="2021-11-30T00:14:01.292+0000">
<tags/>
<scanPlaceholders>true</scanPlaceholders>
<preScannedPlaceholders>false</preScannedPlaceholders>
<placeholders/>
<checksum>
ceae4e8f81e0e31f329db19574bdafd54058d912cd3d2953d3247d6f86d3429f
</checksum>
<fileEncodings>
<entry key=".+\.properties">ISO-8859-1</entry>
</fileEncodings>
<fileUri>internal:well-well-well-well.gif</fileUri>
<isRescanned>false</isRescanned>
<targetPath>/tmp</targetPath>
<targetPathShared>true</targetPathShared>
</file.File>

and the bits you would use in your create ci task are -

<tags/>
<scanPlaceholders>true</scanPlaceholders>
<preScannedPlaceholders>false</preScannedPlaceholders>
<placeholders/>
<checksum>
ceae4e8f81e0e31f329db19574bdafd54058d912cd3d2953d3247d6f86d3429f
</checksum>
<fileEncodings>
<entry key=".+\.properties">ISO-8859-1</entry>
</fileEncodings>
<fileUri>internal:well-well-well-well.gif</fileUri>
<isRescanned>false</isRescanned>
<targetPath>/tmp</targetPath>
<targetPathShared>true</targetPathShared>
</file.File>

https://docs.xebialabs.com/generated/xl-deploy/10.2.x/rest-api/com.xebialabs.deployit.engine.api.RepositoryService.html#/repository/ci/{ID:.+}:GET

…but that doesn’t help with getting your script file uploaded to deploy’s repository. typically file artifacts are not imported this way, usually they are either included in an deployment package that is imported from a build tool (like jenkins), or stored in an artifact repository (such as artifactory or nexus) and referenced in the deployment package by the ci definition via the fileuri (for example - http://artifactory-service/repo/file_artifact.sh)

uploading the artifact into release is not going to work

Noted with thanks, we plan upload our artifact(file and script) into Nexus raw repo and refer from xl deploy.