![](/img/trans.png)
[英]jenkins declarative pipeline not working for xl-deploy using maven command
[英]Not able to create task from xl-deploy cli
我想嘗試使用 cli 部署 dar 文件。 我已經在我們的一台構建機器上設置了 cli。
我也瀏覽了文檔( https://docs.xebialabs.com/xl-deploy/4.5.x/climanual.html )。 但是當我運行下面的代碼時。 我在創建任務的步驟中遇到錯誤。
# Import package
deployit> package = deployit.importPackage('demo-application/1.0')
# Load environment
deployit> environment = repository.read('Environments/DiscoveredEnv')
# Start deployment
deployit> deploymentRef = deployment.prepareInitial(package.id, environment.id)
deployit> deploymentRef = deployment.generateAllDeployeds(deploymentRef)
deployit> taskID = deployment.deploy(deploymentRef).id
deployit> deployit.startTaskAndWait(taskID)
錯誤:
javax.ws.rs.ProcessingException: com.thoughtworks.xstream.converters.ConversionException:
---- Debugging information ----
cause-exception : java.lang.NullPointerException
cause-message : Name is null
class : com.xebialabs.deployit.engine.api.execution.SerializableTask
required-type : com.xebialabs.deployit.engine.api.execution.SerializableTask
converter-type : com.xebialabs.deployit.booter.remote.xml.TaskConverterSelector
path : /task
line number : 1
version : not available
-------------------------------
我該如何解決這個問題?
這是一個示例,您可以在其中啟動部署任務,檢查每個步驟的狀態並打印失敗的日志,
# Load package
package = repository.read('Applications/TestApps/1.0')
# Load environment
environment = repository.read('Environments/TestingEnv')
# Start deployment
deploymentRef = deployment.prepareInitial(package.id, environment.id)
depl = deployment.prepareAutoDeployeds(deploymentRef)
task = deployment.createDeployTask(depl)
deployit.startTaskAndWait(task.id)
# Check on deployment errors
steplist = tasks.steps(task.id)
for s in steplist.steps:
print(' Step: ' + s.description)
print(' Status: ' + str(s.state))
if str(s.state) == 'FAILED':
print('ERROR ' + s.log)
您還可以查看位於“ XLD_INSTALL_HOME/log/deployit.log ”下的 XLDeploy 服務器上的 XLDeploy 日志文件,以在出現錯誤時獲取更多詳細信息。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.