Closed bfk closed 1 year ago
Hi @bfk thanks for this - there's actually some PRs open on the kit to do most of this, but I think time constraints and our lack of familiarity with PaaS prevented us from merging.
One question - is it possible to get the .cfignore
to mirror the .gitignore
? There's other files in there that should likely not get sent up as well as /node_modules/
.
@edwardhorsford You can symlink .cfignore
to .gitignore
Command: ln -s .gitignore .cfignore
@quis can this be done as part of the kit? Ie not something our end users have to do.
Yeah, you can just run that command then commit the changes to the kit.
No longer relevant as PaaS is being retired.
Given the awesomeness of building and prototyping using production-like methods and the existence of the GOV.UK PaaS, I suggest making some small tweaks to make it easier to deploy prototype kit applications to the PaaS.
In order to make it possible to deploy a govuk prototype app to either heroku or CloudFoundry/PaaS, I needed to do the following to a vanilla install of the kit:
.cfignore
file to the project root containing onlynode_modules/
. The node modules within the app contain symlinks to/usr/bin
which heroku deals with but fail when staging to CloudFoundry. Easier to let CloudFoundry get what it needs automatically.package.json
, changed theengines.node
setting specifically to"node": "6.12.0"
. The more sophisticated syntax fails on CloudFoundry and there are a limited number of node versions supported currently on PaaS.manifest.yml
file to the project root, containingPretty minor. Those changes could all be added to the default kit without the user being aware or bothered. In terms of user actions and therefore docs changes, the only change I made compared to the heroku config was changing
heroku config:set USERNAME=username_here
tocf set-env APPNAME USERNAME username_here
, and the same withPASSWORD
to control the basic auth.After those changes, the app could be deployed via
git push heroku master
orcf push APPNAME
and worked on both platforms.Obviously there were the couple of additional PaaS steps of registering for a PaaS account and downloading the CloudFoundry CLI. Then after checking
cf target
, justcf push APPNAME
and done.I'm sure that actual developers (not me!) could do a more straightforward job of this, but it seems like we are only a few steps away from making it trivial to deploy GOV.UK Prototype Kit apps to GOV.UK PaaS instead of or in addition to Heroku, and it might be in the longer-term GDS interest to do so.
Cheers!