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

JENKINS-23485 - TokenMacro for getting a version value stored in environment variable #128

Merged
merged 1 commit into from Aug 5, 2015

Conversation

@dawidmalina
Copy link
Contributor

dawidmalina commented Jul 7, 2015

No description provided.

@dawidmalina

This comment has been minimized.

Copy link
Contributor Author

dawidmalina commented Jul 7, 2015

@patbos this change is based on your pull request - JENKINS-23249 - implementation of POM_VERSION macro

@dawidmalina dawidmalina changed the title Ability to use token POM_VERSION JENKINS-23249 - implementation of POM_VERSION macro Jul 7, 2015
@dawidmalina

This comment has been minimized.

Copy link
Contributor Author

dawidmalina commented Jul 8, 2015

Remove maven-plugin dependency.

@dawidmalina

This comment has been minimized.

Copy link
Contributor Author

dawidmalina commented Jul 8, 2015

Added more coverage

@patbos

This comment has been minimized.

Copy link
Member

patbos commented Jul 13, 2015

Thanks for the PR! Really wants this, but I think the maven-plugin is a better home for the functionality. There is a PR (jenkinsci/maven-plugin#47) with this functionality for the maven-plugin.

@patbos

This comment has been minimized.

Copy link
Member

patbos commented Jul 13, 2015

But perhaps a way is to create a more general macro called like PARSE_VERSION that takes parses a environment variable name and optional parameter to strip snapshot.

@dawidmalina

This comment has been minimized.

Copy link
Contributor Author

dawidmalina commented Jul 13, 2015

This is very good idea to propose this generic variable. I will provide this change next week (currently I'm out) or you can merge it as is and just rename this variable.

@dawidmalina dawidmalina changed the title JENKINS-23249 - implementation of POM_VERSION macro JENKINS-23249 - implementation of PARSE_VERSION macro Jul 20, 2015
@@ -59,7 +59,7 @@ public Environment setUp(AbstractBuild build, Launcher launcher, BuildListener l
InterruptedException {
try {

String version = TokenMacro.expand(build, listener, getVersionTemplate());
String version = TokenMacro.expandAll(build, listener, getVersionTemplate());

This comment has been minimized.

Copy link
@dawidmalina

dawidmalina Jul 22, 2015

Author Contributor

This will allow to use all variables like this: ${ENV,var="NODE"}

@warden

This comment has been minimized.

Copy link

warden commented Jul 22, 2015

+1 this will be useful and actually a better place than in maven-plugin since it can be used in freestyle projects.

@dawidmalina dawidmalina changed the title JENKINS-23249 - implementation of PARSE_VERSION macro JENKINS-23485 - TokenMacro for getting a version value stored in environment variable Jul 25, 2015
@dawidmalina

This comment has been minimized.

Copy link
Contributor Author

dawidmalina commented Jul 27, 2015

@patbos What do you think about this change?

@patbos

This comment has been minimized.

Copy link
Member

patbos commented Jul 27, 2015

Looks good! Im just missing help text for the macro. Create file:
src/main/resources/se/diabol/jenkins/pipeline/ParseVersionTokenMacro/help.jelly
containing help text for the macro. See examples:
https://github.com/jenkinsci/git-plugin/blob/master/src/main/resources/hudson/plugins/git/GitBranchTokenMacro/help.jelly
https://github.com/jenkinsci/token-macro-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/tokenmacro/impl/EnvironmentVariableMacro/help.jelly

@dawidmalina

This comment has been minimized.

Copy link
Contributor Author

dawidmalina commented Jul 28, 2015

Done

@dawidmalina

This comment has been minimized.

Copy link
Contributor Author

dawidmalina commented Aug 3, 2015

When you can merge this?

@patbos

This comment has been minimized.

Copy link
Member

patbos commented Aug 4, 2015

I looked at the issue and it was mentioning the name ENV_VERSION for the macro name. I think it is a better name than the PARSE_VERSION. What do you think?

@dawidmalina

This comment has been minimized.

Copy link
Contributor Author

dawidmalina commented Aug 4, 2015

No problem I will change it tommorow.

…ronment variable

JENKINS-23249 - implementation of PARSE_VERSION macro
@dawidmalina

This comment has been minimized.

Copy link
Contributor Author

dawidmalina commented Aug 5, 2015

Done

patbos added a commit that referenced this pull request Aug 5, 2015
JENKINS-23485 - TokenMacro for getting a version value stored in environment variable
@patbos patbos merged commit 0cd1b80 into Diabol:master Aug 5, 2015
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.006%) to 99.242%
Details
@dawidmalina dawidmalina deleted the dawidmalina:pom-version-macro branch Aug 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.