AWS CodePipeline 将 Spring Boot 应用程序部署到源根级别的 Elastic BeansTalk 没有 .jar 文件
我通过 3 个步骤为 SpringBoot Java 应用程序构建了一个简单的 CodePipeline:
Source: get the source from GitHub
Build: a jar file
Deploy: to an AWS Elastic Beanstalk instance
我在日志中遇到了此错误
执行命令 [app-deploy] 时发生错误 - [CheckProcfileForJavaApplication]。停止运行该命令。错误: 源的根级别没有 Procfile 和 .jar 文件 捆绑
我的构建规范:
version: 0.2
#env:
#variables:
# key: "value"
# key: "value"
#parameter-store:
# key: "value"
# key: "value"
#secrets-manager:
# key: secret-id:json-key:version-stage:version-id
# key: secret-id:json-key:version-stage:version-id
#exported-variables:
# - variable
# - variable
#git-credential-helper: yes
#batch:
#fast-fail: true
#build-list:
#build-matrix:
#build-graph:
phases:
install:
runtime-versions:
java: corretto11
#If you use the Ubuntu standard image 2.0 or later, you must specify runtime-versions.
#If you specify runtime-versions and use an image other than Ubuntu standard image 2.0, the build fails.
#runtime-versions:
# name: version
# name: version
#commands:
# - command
# - command
#pre_build:
#commands:
# - command
# - command
build:
commands:
- mvn install
# - command
# - command
#post_build:
#commands:
# - command
# - command
#reports:
#report-name-or-arn:
#files:
# - location
# - location
#base-directory: location
#discard-paths: yes
#file-format: JunitXml | CucumberJson
artifacts:
files:
- target/sbk-0.0.2.jar
# - location
# - location
#name: $(date +%Y-%m-%d)
#discard-paths: yes
#base-directory: location
#cache:
#paths:
# - paths
当我手动上传到 EBS 时工作正常,但当使用管道上传时,它不起作用。
提前致谢
I built a simple CodePipeline for a SpringBoot Java application with 3 steps:
Source: get the source from GitHub
Build: a jar file
Deploy: to an AWS Elastic Beanstalk instance
I had this error in logs
An error occurred during execution of command [app-deploy] -
[CheckProcfileForJavaApplication]. Stop running the command. Error:
there is no Procfile and no .jar file at root level of your source
bundle
My Buildspec:
version: 0.2
#env:
#variables:
# key: "value"
# key: "value"
#parameter-store:
# key: "value"
# key: "value"
#secrets-manager:
# key: secret-id:json-key:version-stage:version-id
# key: secret-id:json-key:version-stage:version-id
#exported-variables:
# - variable
# - variable
#git-credential-helper: yes
#batch:
#fast-fail: true
#build-list:
#build-matrix:
#build-graph:
phases:
install:
runtime-versions:
java: corretto11
#If you use the Ubuntu standard image 2.0 or later, you must specify runtime-versions.
#If you specify runtime-versions and use an image other than Ubuntu standard image 2.0, the build fails.
#runtime-versions:
# name: version
# name: version
#commands:
# - command
# - command
#pre_build:
#commands:
# - command
# - command
build:
commands:
- mvn install
# - command
# - command
#post_build:
#commands:
# - command
# - command
#reports:
#report-name-or-arn:
#files:
# - location
# - location
#base-directory: location
#discard-paths: yes
#file-format: JunitXml | CucumberJson
artifacts:
files:
- target/sbk-0.0.2.jar
# - location
# - location
#name: $(date +%Y-%m-%d)
#discard-paths: yes
#base-directory: location
#cache:
#paths:
# - paths
it'is work fine when I upload manualy to EBS but when do it withe the pipeline , its doesnt work.
thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了解决方案
AWS BS在pckaging文件夹中找不到jar,他找到了target/xx.jar
我所做的是将 jar 移动到主文件夹
这个命令
充满了构建规范
I found the solution
AWS BS dont found the jar in the pckaging folder, he found target/xx.jar
What i did is i move the jar to main folder
with this commande
full of buildspec