Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put deployed commit into footer #51

Closed
elsbrock opened this issue Feb 7, 2015 · 2 comments
Closed

Put deployed commit into footer #51

elsbrock opened this issue Feb 7, 2015 · 2 comments

Comments

@elsbrock
Copy link
Collaborator

elsbrock commented Feb 7, 2015

Not sure how to do this best. I thought about either modifying the template (replacing a placeholder) or creating a CHANGELOG.json in dist which we could then get via AJAX.

I had a look at grunt-git-log-json which requires the usage of tags for each deployed version. There is also grunt-git-describe which does not natively support writing to files.

I think we only need the latest commit SHA. We could also do this via Travis, but I think it would be really nice if we could keep the local build process as equal as possible.

@blabber
Copy link
Member

blabber commented Feb 7, 2015

Could we use the ident filter documented in gitattributes(5). PoC inc.

blabber added a commit to blabber/rzl-homepage that referenced this issue Feb 7, 2015
Proof of concept for raumzeitlabor#51

Someone should fix the layout ;)
@elsbrock
Copy link
Collaborator Author

elsbrock commented Feb 7, 2015

A disadvantage of the current way is that it modifies all files, therefore rsyncing all files which each build to premium.

Maybe it's better to either write the commit to a separate JSON files and getting that via AJAX as originally proposed, or create a separate page. The AJAX request could be done on-demand (e.g. as soon as bottom of page is visible).

@elsbrock elsbrock reopened this Feb 7, 2015
elsbrock added a commit that referenced this issue Feb 7, 2015
Our first approach for #51 always modified the jekyll template to
contain the latest git commit SHA. The disadvantage is that we always
modify all files, even if only a subset actually changed. This means
Travis always deploys all affected HTML files with each build.

This commit instead writes the version information into a separate file
called CHANGELOG.json that will be fetched on demand by the browser as
soon as the user views the footer. This reduces the files required to
be updated on premium and is very conservative in terms of bandwidth.

I was initially afraid to break /bilder where we are also using a
waypoint on the footer. It does however seem to work fine.

closes #51
elsbrock added a commit that referenced this issue Feb 7, 2015
Our first approach for #51 always modified the jekyll template to
contain the latest git commit SHA. The disadvantage is that we always
modify all files, even if only a subset actually changed. This means
Travis always deploys all affected HTML files with each build.

This commit instead writes the version information into a separate file
called CHANGELOG.json that will be fetched on demand by the browser as
soon as the user views the footer. This reduces the files required to
be updated on premium and is very conservative in terms of bandwidth.

I was initially afraid to break /bilder where we are also using a
waypoint on the footer. It does however seem to work fine.

closes #51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants