我试图从 BitBucket 创建一个将 Master 分支部署到 Heroku 的管道。我做错了什么?! 对于模板,我使用了https://medium.com/finnovate-io/deploy-code-to-multiple-heroku-environments-with-bitbucket-pipeline-3d64c86887d8这似乎是推荐的模板。
拜托-感谢收到的任何想法/帮助:)
流水线文件:
clone:
depth: full
pipelines:
default:
- step:
caches:
- node
script:
# This gets executed on every push by a developer
- npm install
- npm test
branches:
development:
- step:
name: 'Deployment to staging'
deployment: staging
caches:
- node
script:
# This gets executed when merging a PR to dev branch
- npm install
- npm test
# We need to compile code, code is typically stored in
# a destination directory.
# Replace with your own command
#- npm run build:staging
# We need to commit build in the image before pushing
- git add -A
- git config --global user.email "XXXXXXXXXXXX"
- git config --global user.name "XXXXXXXXXXXX"
- git commit -m "staging build"
# Finally, we push to Heroku
- git push -f https://heroku:[email protected]/XXXXXXXXXXXX.dev.git development:master
master:
- step:
name: 'Deployment to live'
deployment: production
caches:
- node
script:
# This gets executed when merging a PR to master branch
- npm --loglevel=error install
- npm-check-updates -u
- npm test
- npm run build:master
- git add -A
- git config --global user.email "XXXXXXXXXXXX"
- git config --global user.name "XXXXXXXXXXXX"
- git commit -m "production build"
- git push -f https://heroku:[email protected]/XXXXXXXXXXXX.git master
输出:
+ npm --loglevel=error install
> [email protected] install /opt/atlassian/pipelines/agent/build/node_modules/sharp/node_modules/node-addon-api
> node-gyp rebuild
gyp: binding.gyp not found (cwd: /opt/atlassian/pipelines/agent/build/node_modules/sharp/node_modules/node-addon-api) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/bin/versions/node/v4.2.1/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:355:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 5.10.101
gyp ERR! command "/bin/versions/node/v4.2.1/bin/node" "/bin/versions/node/v4.2.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/atlassian/pipelines/agent/build/node_modules/sharp/node_modules/node-addon-api
gyp ERR! node -v v4.2.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
> [email protected] postinstall /opt/atlassian/pipelines/agent/build/node_modules/gulp/node_modules/undertaker/node_modules/es6-weak-map/node_modules/es5-ext
> node -e "try{require('./_postinstall')}catch(e){}" || exit 0
> [email protected] postinstall /opt/atlassian/pipelines/agent/build/node_modules/gulp/node_modules/gulp-cli/node_modules/semver-greatest-satisfied-range/node_modules/sver-compat/node_modules/es6-iterator/node_modules/es5-ext
> node -e "try{require('./_postinstall')}catch(e){}" || exit 0
> [email protected] postinstall /opt/atlassian/pipelines/agent/build/node_modules/gulp/node_modules/gulp-cli/node_modules/semver-greatest-satisfied-range/node_modules/sver-compat/node_modules/es6-symbol/node_modules/d/node_modules/es5-ext
> node -e "try{require('./_postinstall')}catch(e){}" || exit 0
npm ERR! Linux 5.10.101
npm ERR! argv "/bin/versions/node/v4.2.1/bin/node" "/bin/versions/node/v4.2.1/bin/npm" "--loglevel=error" "install"
npm ERR! node v4.2.1
npm ERR! npm v2.14.7
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the node-addon-api package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node-addon-api
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /opt/atlassian/pipelines/agent/build/npm-debug.log