首页 文章

无法使用bitbucket管道在Heroku中部署spring-boot应用程序

提问于
浏览
0

我正在尝试使用bitbucket管道在heroku中进行部署,并使用spring-boot创建了一个简单的Web应用程序 .

我想知道你们中是否有人对“bitbucket-pipelines.yml”文件中有什么需要?这是我第一次使用带有bitbucket管道的heroku而且我很丢失 .

我的文件看起来像这样:

image: maven:3.3.9   
clone:
  depth: full

pipelines:
  default:
    - step:
        script: # Modify the commands below to build your repository.
          - mvn -B clean install -P heroku # -B batch mode makes Maven less verbose
          - git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD

1 回答

  • 1

    我建议采取以下步骤:

    • 按照Bitbucket Pipelines文档中Deploy to Heroku中提到的步骤1进行操作 .

    • 请使用以下内容编辑“bitbucket-pipelines.yml”文件:

    image: maven:3.3.9
    clone:
      depth: full
    pipelines:
      default:
        - step:
          script:
            - git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD
            - mvn clean package
            - kill -9 $(lsof -t -i:<your_app_port_number> -sTCP:LISTEN)
            - java -jar target/<your-app-name>.jar &
    

    注意:

    • 用适当的值替换<your_app_port_number>和<your-app-name> .

    • 请记得使用online validator检查"bitbucket-pipelines.yml"文件 .

相关问题