我对使用 IBM Cloud 非常陌生(这是我第一次)。我有一个 Vue.js 应用程序,我想将它部署在 IBM Cloud 上并进行持续交付。我在 GitHub 存储库中有我的 Vue 项目,我希望能够在更改存储库的主分支时自动部署该项目。我已成功设置工具链,以便“交付管道”在更改主分支时运行。看截图:

我(认为)我已经成功设置了构建阶段,我在其中安装了 npm,然后继续运行命令“npm run build”以创建一个可部署的包,使用以下脚本:
bash
#!/bin/bash
export NODE_VERSION=8
export NVM_VERSION=0.33.11
npm config delete prefix \
&& curl -o-
https://raw.githubusercontent.com/creationix/nvm/v${NVM_VERSION}
/install.sh | bash \
&& export NVM_DIR="$HOME/.nvm" \
&& . $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default \
&& node -v \
&& npm -v
echo "Installing NPM"
npm install
echo "NPM install successful"
echo "Attempting npm run build"
npm run build
echo "NPM run build successful"
这就是产生不确定性的地方。我想部署项目,之后npm run build应该只需要 index.hmtl 和 build.js,它们位于“dist”文件夹中。
我不知道这是否有必要,但是在npm installandnpm run build阶段之后,我添加了这个阶段,我真的不知道它是做什么的。我之所以添加它,是因为 Node.js™ 的样板 SDK 在部署阶段之前有这个阶段,请参见屏幕截图 3:

在此之后,我将 Deploy 阶段设置为将“简单构建”阶段作为其输入。它使用一个简单的 Cloud Foundry 推送命令来部署它。但是,在下载各种构建包后,我在日志中收到了这些错误:
Staging...
-----> IBM SDK for Node.js Buildpack v3.25.1-20190115-1637
Based on Cloud Foundry Node.js Buildpack v1.5.24
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NPM_CONFIG_PRODUCTION=true
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)
Resolving node version (latest stable) via 'node-version-resolver'
Installing Node.js (6.16.0) from cache
Using default npm version: 3.10.10
-----> Restoring cache
Loading 2 from cacheDirectories (default):
- node_modules
- bower_components (not cached - skipping)
-----> Building dependencies
Installing node modules (package.json)
-----> Installing App Management
WARN: App Management cannot be installed because the start script cannot be found.
To install App Management utilities, specify your 'node' start script in 'package.json' or 'Procfile'.
Checking for Dynatrace credentials
No Dynatrace Service Found (service with substring dynatrace not found in VCAP_SERVICES)
-----> Caching build
Clearing previous node cache
Saving 2 cacheDirectories (default):
- node_modules
- bower_components (nothing to cache)
-----> Build succeeded!
└── vue@2.6.10
! This app may not specify any way to start a node process
http://docs.cloudfoundry.org/buildpacks/node
Exit status 0
Staging complete
Uploading droplet, build artifacts cache...
Uploading build artifacts cache...
Uploading droplet...
Uploaded build artifacts cache (15.3M)
Uploaded droplet (29.4M)
Uploading complete
Stopping instance 64ed3f5f-71eb-477b-afc1-0e07e2e74fdb
Destroying container
Successfully destroyed container
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 crashed
FAILED
Error restarting application: Start unsuccessful
有任何想法吗?我哪里错了?任何帮助将不胜感激!
