gpt4 book ai didi

java - Gitlab CI Heroku 部署使用dpl工具报错

转载 作者:行者123 更新时间:2023-12-01 17:23:40 25 4
gpt4 key购买 nike

我想使用 Gitlab CI 将我的 war 文件部署到 heroku。我完成了所有更改, war 已部署,但 Heroku 日志显示找不到 webrunner jar。

当我执行 heroku log --tail 时,日志显示为:

enter image description here

从 Gitlab 部署阶段日志中,我可以确认我位于正确的目录中并且已生成必要的文件。

enter image description here

下面是我的文件的样子。

pom.xml

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals><goal>copy</goal></goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.heroku</groupId>
<artifactId>webapp-runner</artifactId>
<version>9.0.30.0</version>
<destFileName>webapp-runner.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>

.gitlab-ci.yml

stages:
- build
- deploy

build:
image: maven:latest
stage: build
tags:
- able-tag
script:
- echo "build stage"
- mvn package -B
artifacts:
paths:
- target
retry: 1

deploy:
stage: deploy
tags:
- able-tag
image: ruby:latest
script:
- apt-get update -qy
- apt-get install -y ruby-dev
- gem install dpl
- pwd
- ls target
- dpl --provider=heroku --app=$APP_NAME --api-key=$API_KEY
dependencies:
- build

Proc文件

web: java $JAVA_OPTS -jar target/dependency/webapp-runner.jar --port $PORT target/*.war

最佳答案

终于,我解决了这个问题。就代码而言,没有任何问题。我在 Heroku 中创建了一个新的部署,然后运行管道,它的工作非常顺利。

关于java - Gitlab CI Heroku 部署使用dpl工具报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61243694/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com