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

Build Feature - Version Increment #16

Closed
1 task
jonpas opened this issue Feb 19, 2019 · 4 comments
Closed
1 task

Build Feature - Version Increment #16

jonpas opened this issue Feb 19, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@jonpas
Copy link
Collaborator

jonpas commented Feb 19, 2019

release MINOR/MAJOR/PATCH with build always increased (if it exists).

Could also do release --inc minor/major/patch.

  • Templating in version
@BrettMayson BrettMayson changed the title Version update Build Feature - Version Increment Feb 20, 2019
@BrettMayson BrettMayson added the enhancement New feature or request label Feb 20, 2019
@BrettMayson BrettMayson modified the milestones: 0.5.0, 0.6.0 Feb 20, 2019
@bovine3dom
Copy link

bovine3dom commented Feb 27, 2019

For smaller projects I often just use the day's date as a version signifier - could HEMTT support that? E.g, 2019.02.17.

@BrettMayson
Copy link
Owner

Once templating is done, you should be able to do that

@BrettMayson BrettMayson modified the milestones: 0.6.0, 0.7.0 Apr 8, 2019
@jonpas
Copy link
Collaborator Author

jonpas commented Jun 20, 2019

@bovine3dom this is how it would look like with date templating, just need to support version templating.

version = "{{date \"%Y\"}}.{{date \"%m\"}}.{{date \"%d\"}}"

This request is probably best implement with a version utility which can:

  • Update versions in specified files
  • Increment version and apply it back to project
  • Be used in scripts (to be ran manually or by external script before releases - not all release builds):
[scripts.version]
show_output = true
steps = [
    "@version -i build",
    "git commit -am \"Prepare release {{version}}\""
]
  • Usage example:
$ hemtt version -i minor  # Increment minor number
$ hemtt run version  	  # Run helper script (build number + git commit)

This is of course entirely up to the project and how they handle or wish to handle releases. But I think we shouldn't do any invasive git operations automatically in HEMTT, scripts provide a perfect way to accomplish that. I came up with this examples from how we would want to do it in ACE3/CBA (how it is done) and ACRE2 (how Jenkins would do it through external script).


Idea on version file list configuration (files that contain version that needs updating):

# Specify files where version needs updating, without source (script_version.hpp)
version_files = [
    "mod.cpp",
    "README.md"
]

Ideas on version utility usage:

$ hemtt version # Argument --update -u maybe?
$ hemtt version --increment major
$ hemtt version --inc minor	# Maybe not?
$ hemtt version -i patch
$ hemtt version -i build
  • version would update all files specified in version_files config using p.version as source
    • Regex matching
      • x.y.z and x.y.z.w fits HEMTT version specification very well, could just match on that like we do in ACE3's and CBA's make.py
  • version -i would just update p.version and run version routine (above)
    • In case where template is specified for version, it would use that (eg. date)
      • Problem: How do we specify that in script_version.hpp? Does HEMTT config overwrite that and we automatically add script_version.hpp into version_files with special handling (different definition)?

This is all largely taken from ACE3/CBA/ACRE2's make.py where I implemented a very similar system.


Ideally, we could also support:

$ hemtt version -i minor
$ hemtt run release
[scripts.release]
show_output = true
steps = [
    "@version -i build", # Would automatically use date specifier as above
    "git commit -am \"Prepare release {{version}}\"",
    "build --release -f", # After version commit, we want headerext to be up-to-date
 	"git push" # Push preperation commit
]

For that, we need to allow running HEMTT commands inside scripts - though warning, could end up in a loop if not used correctly.

@BrettMayson BrettMayson removed this from the 0.7.0 milestone Jun 29, 2019
@BrettMayson
Copy link
Owner

This is now possible with hooks, I don't think a specific command is needed

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

No branches or pull requests

3 participants