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

Including build info into application #106

Merged
merged 3 commits into from
May 25, 2020
Merged

Conversation

local-minimum
Copy link
Contributor

@local-minimum local-minimum commented May 25, 2020

Adding a cli flag:

$ ~/go/bin/rac -version
Version v0.2.0 Commit e39b988 @ 2020-05-25T07:29:30Z

Adding info in the specifications row of the csv headers:

$ head -n 2 out/CCD.csv
CODE,v0.2.0 (e39b988) @ 2020-05-25T07:29:30Z,RAMSES,SPU045-S2:6F,INNOSAT,IS-OSE-ICD-0005:1,Specification,AEZICD002:H
File,ProcessingDate,RamsesTime,...

I tried to directly place the variables in common.Version etc. instead of main.Version but that doesn't seem to work and though a bit ugly perhaps this solution of main transferring its values to common is 🆗 ?

@joakimmoller Is this working on windows?

The if-case in the FullVersion function is mostly there for testing. Building tests with ldflags didn't seem to work and besides this makes tests cases nicer.

Limitation: The version is just the most recent tag on the repository, so if we tag for other reason than making a release it will show that tag instead of the proper version.

Resolves #29

@local-minimum local-minimum requested a review from a team May 25, 2020 08:31
Copy link
Contributor

@joakimmoller joakimmoller left a comment

Choose a reason for hiding this comment

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

Works fine on windows except for parsing the date.

Makefile Outdated Show resolved Hide resolved
@local-minimum local-minimum merged commit c489b1b into master May 25, 2020
@local-minimum local-minimum deleted the versioning-code-attempt2 branch May 25, 2020 11:48
@local-minimum local-minimum added the enhancement New feature or request label May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

We need versioning of our code in output files!?
2 participants