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

Azure DevOps - Git branch name #438

Closed
dandragut opened this issue Sep 30, 2019 · 7 comments
Closed

Azure DevOps - Git branch name #438

dandragut opened this issue Sep 30, 2019 · 7 comments
Milestone

Comments

@dandragut
Copy link
Contributor

dandragut commented Sep 30, 2019

Describe your idea

AzureDevops checks out Git branches in detached mode, resulting in git.branch being populated with the commit hash.

Expected Behavior

The branch name can be populated from BUILD_SOURCEBRANCHNAME environment vaiable as per Azure Devops / Azure Pipelines - Build variables

Additional context

Will provide a pull request soon with proposed changes for review.

@TheSnoozer
Copy link
Collaborator

Thanks for creating an issue! That sounds reasonable.

Just as a hint (if you not already know):
This sounds like it would be similar to the TravisBuildServerData or other BuildExtractors we already have for other CI environments. I guess in the easiest case you just need to write one for the Azure environment and extend the functionality to obtain such provider.

@dandragut
Copy link
Contributor Author

Thanks @TheSnoozer

I had a quick look around at the Azure Pipeline environment variables and the source code, I found exactly what you pointed out, thanks for that. Running some tests now and creating the pull request soon for you guys to review (Y)

@TheSnoozer
Copy link
Collaborator

Thanks for making the changes and improving this project!
Feel free to assign the MR to me and I'll review when I got some free time ;-)

dandragut added a commit to dandragut/maven-git-commit-id-plugin that referenced this issue Oct 2, 2019
TheSnoozer added a commit that referenced this issue Oct 2, 2019
Issue #438 Populate "git.branch" and "git.build.number" for Azure DevOps
@TheSnoozer
Copy link
Collaborator

Implemented via #439.

Thanks for your contribution!

@TheSnoozer TheSnoozer added this to the 3.0.2 milestone Oct 2, 2019
@dandar3
Copy link

dandar3 commented Oct 2, 2019

@TheSnoozer Entirely my pleasure, thank you guys for writing the plugin in the first place! (Y)

@TheSnoozer
Copy link
Collaborator

It's always great to know that this plugin is still in use :-)
I personally have switched to gradle which has other downsides compared to maven ;-)

Anyhow, as far as i remember travis deploys snapshots of the master-branch to oss-sonatype. if you want to start to use this feature you could already do so, by specifying the Sonatype-Snapshot repo.

e.g.

<pluginRepositories>
    <pluginRepository>
        <id>sonatype-snapshots</id>
        <name>Sonatype Snapshots</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </pluginRepository>
</pluginRepositories>

If you'd prefer a more official release feel free to ping me in #432. Releases only happen randomly or when users (YOU) ask for it ;-)

@dandar3
Copy link

dandar3 commented Oct 5, 2019

Thank you, didn't know about the Sonatype snapshot builds, I had deployed mine on our Artficatory to be able to test it. Thanks for the notes, whenever you feel it's worth releasing it it's fine, no pressure :-)

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

No branches or pull requests

3 participants