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

Have version information (of the release) in the index.html #13

Open
PaulBoon opened this issue Aug 2, 2023 · 2 comments
Open

Have version information (of the release) in the index.html #13

PaulBoon opened this issue Aug 2, 2023 · 2 comments

Comments

@PaulBoon
Copy link
Collaborator

PaulBoon commented Aug 2, 2023

Currently the metrics webpage (index.html) does not have the version number of the dv-metrics release used.
This makes it cumbersome to check what version has been deployed and thus if upgrades have been done.

The initial idea is to just add that version info to the footer of that page.

@PaulBoon
Copy link
Collaborator Author

PaulBoon commented Aug 2, 2023

Instead of 'hardcoding' it in the html footer we can add it as a meta tag in the html header;

<meta name="version" content="1.2.0">

If we then want to show it on the page we don't want to duplicate it, but instead we can get the value and create some elements with JavaScript. For instance with jQuery you can get the version string like this:

var version = $('meta[name=version]').attr('content');

This also allows to make the display optional and configurable.

As a workaround my deploy (ansible) script now injects the version like this:

- name: Inject version info
  lineinfile:
    path: "{{ metrics_extracted_app_path }}/index.html"
    insertbefore: '^(\s*)</head>(\s*)$'
    line: '    <meta name="version" content="{{ metrics_version }}">'

@PaulBoon
Copy link
Collaborator Author

PaulBoon commented Aug 2, 2023

Instead of putting the version in a meta tag in the index.html file we could also put a var in the installationplots.js file. Or we could put the version in a separate version.json file.

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

No branches or pull requests

1 participant