首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在pcf中部署angular2应用

在pcf中部署angular2应用
EN

Stack Overflow用户
提问于 2017-03-10 03:18:21
回答 2查看 6.8K关注 0票数 3

我正在尝试将我的angular2应用程序部署到pivotal cloud foundry上,并且我按照找到here的说明进行了操作,但我一直在获取Loading...,在开发人员控制台中没有发现错误。

代码语言:javascript
复制
/d/gitmyworkspace/mywork/pcfdeploy/src
$ npm install --quite
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
/d/gitmyworkspace/mywork/pcfdeploy/src
$ cf push -b staticfile_buildpack ang-pcf-dep
Creating app ang-pcf-dep in org ORG / space development as myDetails...OK
Creating route ang-pcf-dep.domain.com... OK
Binding ang-pcf-dep.domain.com to ang-pcf-dep... OK
Uploading ang-pcf-dep...
Uploading app files from: D:\gitmyworkspace\mywork\pcfdeploy\src
Uploading 12.9K, 18 files Done uploading OK
Starting app ang-pcf-dep in org ORG / space development as myDetails...
Downloading staticfile_buildpack...Downloaded staticfile_buildpack
Creating container    Successfully created container  Downloading app package...
Downloaded app package (6.4K)   Staging...
-------> Buildpack version 1.3.6
Downloaded [file:///tmp/buildpacks/5d1fcb59173496506d68186968a7b83f/dependencies/https___pivotal-buildpacks.s3.amazonaws.com_concourse-binaries_nginx_nginx-1.9.14-linux-x64.tgz]
grep: Staticfile: No such file or directory
-----> Using root folder
-----> Copying project files into public/
-----> Setting up nginx
grep: Staticfile: No such file or directory
grep: Staticfile: No such file or directory
Exit status 0
Staging complete
Uploading droplet, build artifacts cache...
Uploading build artifacts cache...
Uploading droplet...
Uploaded build artifacts cache (107B)
Uploaded droplet (2.5M)
Uploading complete
1 of 1 instances running
App started  OK
App ang-pcf-dep was started using this command `sh boot.sh`
Showing health and status for app ang-pcf-dep in org ORG /spacedevelopment as myDetails ... OK
requested state: started
instances: 1/1
usage: 1G x 1 instances
urls: ang-pcf-dep.domain.com
last uploaded: Thu Mar 9 18:53:22 UTC 2017
stack: cflinuxfs2
buildpack: staticfile_buildpack
state     since                    cpu    memory       disk         details
#0   running   2017-03-09 10:53:34 AM   0.0%   3.2M of 1G   6.9M of 1G

在浏览器中,它只是加载index.html,而不是像app.component.html这样的其他组件。我刚刚使用webstorm AngularClinode 6.9.5创建了一个基本应用程序来测试pcf deployment

EN

回答 2

Stack Overflow用户

发布于 2017-03-15 08:05:31

对于AngularCli,我们假设要执行以下步骤...

代码语言:javascript
复制
$ng build
$ cd dist
$ cf push -b staticfile_buildpack ang-pcf-dep

请注意,对于AngularCli,您应该从dist文件夹推送,而不是从appsrc文件夹推送,并且所有的资源文件,如图像,都应该在assets文件夹中。感谢来自pcf的Rob

票数 7
EN

Stack Overflow用户

发布于 2018-08-14 19:26:57

另一种方法是创建清单文件(.yml)

cf推送-f清单-xxx-dev(Qa).yml -b staticfile_buildpack

这将有助于维护环境,域更改和所有操作都将变得更容易。

清单文件示例(另存为清单-开发(Qa).yml)

应用程序:-名称:{应用程序}内存: 1024MB实例:1个主机:{environmentFriendlyName}域:- {domainName}超时: 600

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42703699

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档