繁体   English   中英

无法在本地部署 mule 应用程序

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM