CodeBuild和CodeDeploy成功但不运行maven javaweb应用程序的服务器

时间:2017-05-17 02:52:30

标签: spring amazon-web-services tomcat8 aws-code-deploy aws-codebuild

我在aws服务器上使用codestart我的codecommit和codebuild成功但没有部署在tomcat服务器上。这些是buildspec.yml和appspec.yml

  

buildspec.yml

    version: 0.1

    phases:
      install:
        commands:
          - echo Entering install phase...
          - wget http://mirror.olnevhost.net/pub/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
          - tar xzvf apache-maven-3.3.9-bin.tar.gz -C /opt/
          - export PATH=/opt/apache-maven-3.3.9/bin:$PATH
      pre_build:
        commands:
          - echo Entering pre_build phase...
          - echo Nothing to do in the pre_build phase...
      build:
        commands:
          - echo Entering build phase...
          - echo Build started on `date`
          - mvn -f pom.xml compile war:exploded
      post_build:
        commands:
          - echo Entering post_build phase...
          - echo Build completed on `date`
          - mv target/ROOT .
    artifacts:
      type: zip
      files:
        - target/ROOT.war
        - appspec.yml
      discard-paths: yes
  

appspec.yml

    version: 0.0
    os: linux
    files:
      - source: ./ROOT.jar
        destination: /

2 个答案:

答案 0 :(得分:0)

除非您提供有关错误的任何其他信息,否则我不确定如何为您提供帮助。

指点:

  1. 您可以进行代码部署>部署>部署修订> 事件和日志确切地指出出了什么问题。
  2. 如果你有对你的实例的ssh访问权限,你可以去 / opt / code-deploy / deployment-root / deployment-logs查找内容 出错了。

答案 1 :(得分:0)

  • buildspec.yml (需要修改)
  • appspec.yml (删除)

buildspec.yml

    version: 0.1

    phases:
      install:
        commands:
          - echo Entering install phase...
          - wget http://mirror.olnevhost.net/pub/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
          - tar xzvf apache-maven-3.3.9-bin.tar.gz -C /opt/
          - export PATH=/opt/apache-maven-3.3.9/bin:$PATH
      pre_build:
        commands:
          - echo Entering pre_build phase...
          - echo Nothing to do in the pre_build phase...
      build:
        commands:
          - echo Entering build phase...
          - echo Build started on `date`
          - mvn -f pom.xml compile war:exploded
      post_build:
        commands:
          - echo Entering post_build phase...
          - echo Build completed on `date`
          - mv target/ROOT .
    artifacts:
      type: zip
      files:
        - 'ROOT/WEB-INF/**/*'
        - 'ROOT/WEB-INF/classes/*'
        - 'ROOT/WEB-INF/classes/**/*'
        - 'ROOT/WEB-INF/lib/*'
        - 'ROOT/WEB-INF/lib-provided/*'
        - 'ROOT/WEB-INF/js/*'
        - 'ROOT/org/springframework/boot/loader/*' //if you are using spring boot application