mathdown
mathdown copied to clipboard
Implement Netlify Button
https://devcenter.heroku.com/articles/heroku-button https://blog.openshift.com/instant-hosting-of-open-source-projects-with-github-style-ribbons/
Heroku is better for easy fork deployment due to:
- unlimited 1 free dyno per app (vs RHcloud's 3 gears per user)
- no size issues (so far), while on RHcloud I already had to pay a bit for quota doubling
- fast deploy (<1 minute vs 7min)
https://launch-shifter.rhcloud.com/
Heroku Button won't work with submodules :-(
Heroku Button will not work with repos that have Git submodules. Heroku Button relies on the Build API and uses tarballs fetched from GitHub. GitHub does not include submodule contents when repo-content tarballs are generated.
Tried the launch-shifter which IIUC is simply creates a workflow URL:

Clicking asks to login or create user. Created a new user (to check it works for a free user). Filled app name & namespace (http://mathdown1–cbensf.rhcloud.com) but left branch empty. =>
⚠ Unable to complete the requested operation. Show less
Shell command '/sbin/runuser -s /bin/sh 55c9b8900c1e66fd7f0000c0 -c "exec /usr/bin/runcon 'unconfined_u:system_r:openshift_t:s0:c1,c430' /bin/sh -c \" set -xe; shopt -s dotglob; if [ "$(find objects -type f 2>/dev/null | wc -l)" -eq "0" ]; then exit 0; fi git archive --format=tar master | (cd /var/lib/openshift/55c9b8900c1e66fd7f0000c0/app-root/runtime/repo && tar --warning=no-timestamp -xf -); \""' returned an error. rc=1 + shopt -s dotglob + '[' 3 -eq 0 ']' + cd /var/lib/openshift/55c9b8900c1e66fd7f0000c0/app-root/runtime/repo + git archive --format=tar master + tar --warning=no-timestamp -xf - fatal: Not a valid object name tar: This does not look like a tar archive tar: Exiting with failure status due to previous errors
Trying branch = gh-pages... => perhaps working but SLOW. The original page was stuck on spinner, after 4-5 min said:
Application creation is taking longer than expected. Please wait a few minutes, then refresh this page.
The app after 4 minutes was still in "building" status on dashboard (and returned 503). After 7 min, it's alive.
"initial_git_branch: the name of your initial deployment branch. The default value is master."

That pre-filled gh-pages successfully but deployment failed with some error (sorry, lost). Retrying after deleting mathdown1 succeeded. Then successfully launched mathdown3 (7.5min) in parallel to mathdown2, so it's not a resource limit (RHcloud should give 3 free gears).
Closed as I can't implement Heroku button due to lack of submodule support.
Reopening. Openshift online is currently stuck between v2 which no longer accepts signups and v3 which is time-limited preview. The (hypotetical :rofl:) hordes of contributors which want to fork Mathdown and instantly host it, have no trivial option. Heroku is an easy option with git push. Anyway I want the full Heroku Quality of Life — button, review apps(!), possibly auto-deploy from github to staging (though deploy from travis CI might make more sense).
This is blocked on my use of submodules #115. For Heroku should first investigate submodule buildpacks: https://github.com/cben/mathdown/issues/115#issuecomment-145668433
https://github.com/SectorLabs/heroku-buildpack-git-submodule looks promising
As part of #172, I've moved from Heroku to Netlify. It spins up automatic preview apps for PRs. But can still add a Netlify button https://www.netlify.com/blog/2016/11/29/introducing-the-deploy-to-netlify-button/ ?
In any case, should revise README.