[英]Unable to deploy mule application on on prem
我正在嘗試使用 Azure 管道將 Mule 應用程序部署到本地,下面是 Azure-pipelines.yml
trigger:
batch: true
branches:
include:
- develop
paths:
exclude:
- azure-pipelines.yml
variables:
- group: Build-Variable-Group
- name: MAVEN_CACHE_FOLDER
value: $(HOME)/.m2/repository
- name: MAVEN_OPTS
value: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)'
- name: vmImageName
value: 'ubuntu-latest'
stages:
- stage: Verify
displayName: Verification
jobs:
- job: VerifyApi
displayName: Verify raml
pool:
vmImage: $(vmImageName)
steps:
- task: PowerShell@2
displayName: api folder
inputs:
targetType: 'inline'
script: |
$Folder = '$(Build.SourcesDirectory)/src/main/resources/api'
"Test to see if folder [$Folder] exists"
if (Test-Path -Path $Folder) {
echo "$Folder"
"Path exists!"
} else {
"RAML doesn't exit in the GITHUB repository"
exit 1
}
- stage: Build
displayName: Build stage
jobs:
- job: BuildApiManager
displayName: Build API Manager
pool:
vmImage: $(vmImageName)
steps:
- task: CacheBeta@0
inputs:
key: pom.xml
path: $(MAVEN_CACHE_FOLDER)
displayName: Cache Maven local Repo
- task: DownloadSecureFile@1
name: settingsxml
inputs:
secureFile: 'settings.xml'
- task: Powershell@2
inputs:
targetType: 'inline'
script: |
New-Item -Type Directory -Force "${HOME}/.m2"
Copy-Item -Force "$(settingsxml.secureFilePath)" "${HOME}/.m2/settings.xml"
- task: Maven@3
displayName: Deploy API Manager
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
goals: 'clean package -Papi-Danypoint.user=${anypoint.uname} -Danypoint.password=${anypoint.pass} -DorgId=${org.id} -Dversion=${apiVersion} -DenvId=${environment} -DdeploymentType=hybrid -Dpackaging=pom -DassetId=${app.name} -Dpolicy=${policy1}'
- stage: Deploy
displayName: Deploy stage
dependsOn: Build
condition: succeeded()
jobs:
- job: DeployArtifacts
displayName: Deploy & Publish Artifacts
pool:
vmImage: $(vmImageName)
steps:
- task: CacheBeta@0
inputs:
key: pom.xml
path: $(MAVEN_CACHE_FOLDER)
displayName: Cache Maven local Repo
- task: DownloadSecureFile@1
name: settingsxml
inputs:
secureFile: 'settings.xml'
- task: Powershell@2
inputs:
targetType: 'inline'
script: |
New-Item -Type Directory -Force "${HOME}/.m2"
Copy-Item -Force "$(settingsxml.secureFilePath)" "${HOME}/.m2/settings.xml"
- task: Maven@3
displayName: Deploy Runtime Manager
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
goals: 'clean install deploy $(MAVEN_OPTS) -DmuleDeploy -Dserver=$(server) -Denvironment=$(environment) -Dworkers=$(workers) -DworkerType=$(workerType) -Dapp.runtime=$(app.runtime) -Dapp.name=$(app.name)'
Blow 是我在 Azure 管道日志中遇到的錯誤
[ERROR] Failed to execute goal org.mule.tools.maven:mule-maven-plugin:3.3.5:deploy (default-deploy) on project clx-mule-sftp-sapi: Failed to deploy [/home/vsts/work/1/s/target/clx-mule-sftp-sapi-1.0.1-SNAPSHOT-mule-application.jar] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
以下是我在運行時管理器日志中遇到的錯誤
Worker(3.81.37.13): Your application has failed with exception java.lang.IllegalStateException: com.mulesoft.ch.services.agent.muleAgent.MuleAgentException: {"type":"class java.lang.IllegalArgumentException","message":"There was an error on the Mule Runtime while deploying the application clx-mule-sftp-sapi-pdv2. Error: Domain 'domain-sys-api-1.0.1-mule-domain' has to be deployed in order to deploy Application 'clx-mule-sftp-sapi-pdv2'. DomainNotFoundException: The domain 'domain-sys-api-1.0.1-mule-domain' was not found. Available domains: [[default]]"}
我們能夠使用相同的代碼在 cloudhub 中進行部署,但是在嘗試使用相同的代碼在本地部署時(根據 env 更改了變量),它顯示錯誤。
該錯誤清楚地表明該應用程序依賴於一個域:
Error: Domain 'domain-sys-api-1.0.1-mule-domain' has to be deployed in order to deploy Application 'clx-mule-sftp-sapi-pdv2'
在嘗試部署應用程序之前,您需要先部署域。 這些步驟類似於部署應用程序。 有關詳細信息,請參閱文檔。
您不可能將相同的應用程序部署到 CloudHub,因為它不支持域。 我猜您指的是重用相同的部署 model。 您需要了解不同部署目標之間的功能差異。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.