我正在尝试在heroku上部署构建,它是一个nodejs应用程序,我有在推送时触发的管道
这是管道
image: node:18
pipelines:
branches:
dev:
- step:
name: Build Application - (Dev)
script:
- cd backend
- npm install
- npm run build
- step:
name: Create Artifact (Dev)
script:
- cd backend
- git archive --format=tar.gz dev -o application.tar.gz
artifacts:
- backend/application.tar.gz
- step:
name: Deploy to Heroku (Dev)
deployment: Staging
script:
- pipe: atlassian/heroku-deploy:2.3.0
variables:
HEROKU_API_KEY: $HEROKU_API_KEY
HEROKU_APP_NAME: $HEROKU_APP_NAME_TEST
# JWT_SECRET_KEY: $JWT_SECRET_KEY
ZIP_FILE: backend/application.tar.gz
WAIT: "true"
caches:
- node
在最后一步部署到Heroku(开发)它显示错误
Status: Downloaded newer image for bitbucketpipelines/heroku-deploy:2.3.0
WARNING: New version available: atlassian/heroku-deploy '2.3.0' to '2.4.0'
INFO: Creating Heroku sources...
INFO: Uploading binary sources from backend/application.tar.gz
INFO: Starting a new build in Heroku...
✖ Failed to upload binary sources. Expected HTTP Status 201, got 404. Error message: {"id":"not_found","message":"The requested API endpoint was not found. Are you using the right HTTP verb (i.e. GET vs. POST), and did you specify your intended version with the Accept header?"
我想这是因为我的这个应用程序中没有测功机,我正在尝试向其中添加基本测功机类型,但没有选项可以添加测功机
用于创建 bitbucket 部署变量的 Heroku api 密钥
https://dashboard.heroku.com/account/applications -> 授权
我填写了 bitbucket 部署变量
有一个小问题,我没有在 bitbucket 的部署管道中添加所有变量。我添加了变量并部署了构建。
成功部署后,现在也可以选择更改测功机