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

(SDK-274) Adds --version option #90

Merged
merged 4 commits into from
Jun 19, 2017
Merged

Conversation

bmjen
Copy link
Contributor

@bmjen bmjen commented Jun 19, 2017

To allow easy checking and reporting of the current pdk version, {{--version}} should report the installed version of PDK, as well as the vanagon build SHA from a built package or the git ref from a local git repo.

@bmjen bmjen force-pushed the version-info branch 2 times, most recently from abbf4e3 to 4b521d5 Compare June 19, 2017 17:52
end

def self.pdk_ref
ref = pkg_sha || git_ref
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Debating flipping this prioritization. I think if someone installs the official pdk package, but modifies the underlying code (with an initialized git repo), we should be aware of that.

Copy link
Contributor

Choose a reason for hiding this comment

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

In that case it would be good to know both, so maybe they should just each be conditionally added if available?

sha = ver.strip.split('.')[-1] unless ver.nil?
end

sha
Copy link
Contributor

@scotje scotje Jun 19, 2017

Choose a reason for hiding this comment

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

Seems likesha is going to be an undefined var if the version file doesn't exist?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the version file doesn't exist, I'm expecting it to return nil so that we can fall back to git_ref up above.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh right, ruby hoists vars out of if/else blocks.

@scotje scotje merged commit 9eae594 into puppetlabs:master Jun 19, 2017
@DavidS DavidS added the feature label Jun 20, 2017
@bmjen bmjen deleted the version-info branch November 14, 2017 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants