Skip to content
This repository has been archived by the owner on Dec 23, 2017. It is now read-only.

Build assets remotely. #115

Merged
merged 1 commit into from
May 4, 2015
Merged

Conversation

jmcarp
Copy link
Contributor

@jmcarp jmcarp commented May 1, 2015

Build assets on cloud foundry instead of building locally and uploading.
This simplifies deployment somewhat by offloading the work of asset
compilation from the developer's machine to Cloud Foundry and makes the
whole process just a little more reproducible.

  • Symlink .gitignore to .cfignore
  • Use both Python and Node buildpacks
  • Build assets on push

Build assets on cloud foundry instead of building locally and uploading.
This simplifies deployment somewhat by offloading the work of asset
compilation from the developer's machine to Cloud Foundry and makes the
whole process just a little more reproducible.

* Symlink .gitignore to .cfignore
* Use both Python and Node buildpacks
* Build assets on `push`
@jmcarp
Copy link
Contributor Author

jmcarp commented May 1, 2015

Depends on https://github.com/18F/openFEC/pull/680.

@msecret
Copy link
Contributor

msecret commented May 1, 2015

When you say we're building on CF, what CF instance is it building on? I would think that we'd build assets on one CI server (like even Travis) and then upload or transfer to the final instance we're deploying to. If none of this makes any sense, let me know.

@jmcarp
Copy link
Contributor Author

jmcarp commented May 1, 2015

@msecret: The way this patch is written, each Cloud Foundry instance will build assets on deployment. Which, like you said, is it a little wasteful. Longer-term, it might be better to have the 0th instance build the assets and push to CloudFront, or something similar. But IMO it's still worth it to offload compilation to CF--it's one less thing that can break on our side. What do you think?

@arowla
Copy link
Contributor

arowla commented May 1, 2015

I was just pondering how to work out continuous deployment from Travis in light of our dual-app CF manifest (which is set up to push both repos at once, via a relative path) and the need to build stuff on the web app side (which is currently enabled by deploy.sh). This patch would indeed simplify things a lot! I am agnostic on whether it should be done on the CI or on CF. If I had to venture a guess, though, I'd think our flavor of CI is more likely to change than our CF environment anytime soon, so building on CF seems like a decent, if not the most efficient, plan.

@@ -1 +1 @@
web: newrelic-admin run-program gunicorn __init__:app
web: npm run build && newrelic-admin run-program gunicorn __init__:app
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to have an npm install to get any new dependencies, too, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. This patch uses both the python and node buildpacks, so CF autodetects package.json and runs npm install.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, gotchya!

arowla added a commit that referenced this pull request May 4, 2015
@arowla arowla merged commit 8a6e022 into fecgov:develop May 4, 2015
@arowla arowla removed the plz-review label May 4, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants