-
Notifications
You must be signed in to change notification settings - Fork 654
Question: How to use Continous Deployment with GitVersionTask? #417
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
Comments
The GitVersionTask will still respect the GitVersionConfig.yaml file if your project root. Just create the config file using the information at https://github.com/ParticularLabs/GitVersion#branch-configuration Feel free to submit a pull request or update our docs to help others find this info :) |
hmm can't seem to bring up the default config. GitVersion showConfig and GitVersion /showConfig both result in Failed to prepare or find the .git directory in path '/showConfig' |
Can you grab a screenshot of the command window where you are running the command? Also, what is the complete command that you are running? Are you using the targetPath parameter? The error that you are getting suggests that GitVersion has been unable to locate the .git folder which git manages behind the scenes for you. This can happen when you have specified the wrong targetPath parameter, or you are running GitVersion on the command line in the incorrect directory. |
Nothing special, installed via Chocolaty - although I had to skip some step because its not working properly. Ran this is admin cmd... D:\Code\RobGeoLtd\Data.Components>GitVersion D:\Code\RobGeoLtd\Data.Components>GitVersion showConfig D:\Code\RobGeoLtd\Data.Components>GitVersion /showConfig |
ah, hold on.... What version of GitVersion have you got installed? Are you using the latest pre-release version, i.e. 3.0.0-beta2? To install this from chocolatey, you will need to do:
I suspect you might have an earlier version, that isn't recognising the |
with -y it fails, so with -n to stop the script it runs... but its still installing 2.0.1
|
Hmm, that is very strange, hold on... let me try something... |
Hmm, I have just tried this:
And it works as expected. Can you try without the The problem being that GitVersion is/was actually using an undocumented method that was never part of the Public API of Chocolatey. We have taken the decision to add this method into the public API, but the current implementation doesn't work correctly yet, we are working on it though. |
Without --force its the same. (just doesn't install - already installed). I'm on windows 7 btw. Are versions limited to OS at all? Admittedly, I'm new to this. I installed Chocolaty in an admin cmd prompt. It seemed to install happily. Okay, I can attempt to install with a specific version it seems: but its complaining with and without the script now. :/ |
No, the OS shouldn't make any difference. I am running on Windows 7 as well. Ok, do this for me...
After all that, close you console/powershell window and run the following command:
And hopefully that will get you back to a known state. |
Phew... finally, choco install gitversion.portable -version 3.0.0-beta0002 -pre with skip did the trick. Got the config. :) |
Woot! 👍 |
Okay cool this all seems to be working now. Commits to an active release-branch is upping the beta version number. I think I may have had some issues by messing with tags manually (moving them up). After closing and opening a new release via SourceTree, it all seems to be working well. Thank you. :) |
Sorry, spoke too soon. I have some odd behavior with the BuildMetaData number. If I've just been working locally the beta number moves up with each commit as I'm expecting:
However, if I now push the release branch onto the remote server and run GitVersion I get this:
Have I missed something? I've checked back on my build log and I think GitVersion 2 was correctly incrementing the meta number off the remote branch. |
Can you confirm that the same version of GitVersion is being used both locally, and on the server? Sent from my Windows Phone From: Meirion Hughesmailto:[email protected] Sorry, spoke too soon. I have some odd behavior with the BuildMetaData number. If I've just been working locally the beta number moves up with each commit as I'm expecting:
However, if I now push the release branch onto the remote server and run GitVersion I get this:
Reply to this email directly or view it on GitHub: |
I was running GitVersion locally (same cmd prompt) both times. All I did was to have git push the branch onto the remote origin. I then ran GitVersion again locally and the beta number changed down from 4 to 1. What I don't know is whether I'm using this wrong, or its a bug. My understanding was that if I add commits to a release branch, its beta number will increase. I'll freely admit I'm new to all this. :D |
Can you run It will log out some information which might help diagnose |
Before Pushing to Origin:
Output:
Log:
After push to Origin
Output:
Log
They look identical except for base version commit |
So is this a bug or working as intended? If its a bug I'll have a go fixing it. But its not clear. |
I think it's a bug... It doesn't look right |
I've tried to test for it, but I can't seem to get pushing to a remote right :( LibGit2Sharp complains: "Local push doesn't (yet) support pushing to non-bare repos." |
I think I've found the problem. In Extensions-> FindCommitBranchWasBranchedFrom c.GetBranchesContainingCommit(repository, onlyTrackedBranches).ToList() ...includes the remote branch as well as the local. So the count is higher than if the remote branch was behind or not on remote. |
Test and Fix: #442 |
My workflow is to automatically deploy anything from the master or release-* (as pre-release) to nuget (teamcity). I noticed as I commit changes to a release branch that the -beta1 isn't incrementing.
I think I've read that I need to switch to Continuous Deployment mode, but I couldn't see how to do this if I'm just using GitVersionTask off nuget.
The text was updated successfully, but these errors were encountered: