3

I am trying to deploy my angular2 application to pivotal cloud foundry and I followed the instructions found here but I am keep getting Loading..., there are no errors found in developer console.

/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

In browser it is just loading the index.html but not the other components like app.component.html. I just created a basic application using webstorm AngularCli and node 6.9.5 to test the pcf deployment. Please let me know if I missed anything?

user1653027
  • 789
  • 1
  • 16
  • 38

2 Answers2

7

For AngularCli we suppose to do below steps ...

$ng build
$ cd dist
$ cf push -b staticfile_buildpack ang-pcf-dep

please note for AngularCli you should push from dist folder not app or src folder and all resource files like images should be in assets folder. Thanks to Rob from pcf.

user1653027
  • 789
  • 1
  • 16
  • 38
0

Another way is to create a manifest file (.yml)

cf push -f manifest-xxx-dev(qa).yml -b staticfile_buildpack

This will help to maintain environments, and domain changes and all will be easier.

Sample Manifest file (save as manifest-dev(qa).yml)


applications: - name: {Application} memory: 1024MB instances: 1 host: {environmentFriendlyName} domains: - {domainName} timeout: 600