AWS Code Pipeline部署结果为404。

问题描述 投票:0回答:1

我正试图为一个现有的应用程序创建一个管道,这是一个ReactJava Spring Boot应用程序。它是一个ReactJava Spring Boot应用。它通常会被捆绑成一个单一的war文件并上传到ElasticBeanstalk。我创建了我的codebuild项目,当我手动运行它时,它会生成一个战争文件,然后我可以上传到ElasticBeanstalk,一切都正常工作。下面是这个的构建规范。

version: 0.2

phases:
  install:
    commands:
      - echo Nothing to do in the install phase...
  pre_build:
    commands:
      - echo Nothing to do in the pre_build phase...
  build:
    commands:
      - echo Build started on `date`
      - mvn -Pprod package -X
  post_build:
    commands:
      - echo Build completed on `date`
      - mv target/cogcincinnati-0.0.1-SNAPSHOT.war cogcincinnati-0.0.1-SNAPSHOT.war
artifacts:
  files:
    - cogcincinnati-0.0.1-SNAPSHOT.war

当我在流水线上运行这个构建步骤时,它会生成一个zip文件,然后放到S3上。我的部署步骤将该构建工件并将其发送到ElasticBeanstalk。Elasticbeanstalk没有给我任何错误,但当我导航到我的网址时,我得到一个404。

我试着把zip文件直接上传到Elasticbeanstalk,得到的结果也是一样。我已经解压文件,它似乎有我所有的项目文件。

当我查看服务器日志时,我没有看到任何错误。我不明白为什么当我手动运行codebuild时,会生成一个war文件,而在code pipeline中执行时却生成一个zip。

spring-boot amazon-elastic-beanstalk jhipster aws-codepipeline aws-codebuild
1个回答
0
投票

看来你的应用是失败的,你应该查看一下Beanstalk环境的日志,特别是。

  • "Tomcat8catalina.out"
  • "Tomcat8catalina.[date].log"

[1] 在Elastic Beanstalk环境中查看Amazon EC2实例的日志--。https:/docs.aws.amazon.comelasticbeanstalklatestdgusing-features.logging.html。

关于在EB环境下使用Tomcat平台的更多细节,可以参考本文档: - 使用Elastic Beanstalk Tomcat平台 - 弹性豆茎。https:/docs.aws.amazon.comelasticbeanstalklatestdgjava-tomcat-platform.html。

关于项目中的文件夹结构,请参考本文档: - 项目文件夹的结构------。https:/docs.aws.amazon.comelasticbeanstalklatestdgjava-tomcat-platform-directorystructure.html。

© www.soinside.com 2019 - 2024. All rights reserved.