Pushing local git-tag to remote sever
The following is a part of my build output. At the last line(153), I try to push local git-tag to remote server(GitHub), but the build process on AppVeyor(v2-beta) is hung. Is pushing git-tag invalid? or Did I make something wrong?
141CopyFilesToOutputDirectory:
142 Copying file from "obj\Release\AutoFixture.Contrib.UnitTest.dll" to "bin\Release\AutoFixture.Contrib.UnitTest.dll".
143 AutoFixture.Contrib.UnitTest -> C:\projects\citest\test\AutoFixture.Contrib.UnitTest\bin\Release\AutoFixture.Contrib.UnitTest.dll
144 Copying file from "obj\Release\AutoFixture.Contrib.UnitTest.pdb" to "bin\Release\AutoFixture.Contrib.UnitTest.pdb".
145Done Building Project "C:\projects\citest\test\AutoFixture.Contrib.UnitTest\AutoFixture.Contrib.UnitTest.csproj" (Build target(s)).
146NuGetVersioning:
147 Made 1 replacement(s).
148RestoreNuGetVersion:
149 Made 1 replacement(s).
150PushTag:
151 git config --global push.default simple
152 git tag 2.10.3
153 git push origin 2.10.3
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Feodor Fitsner on 01 Mar, 2014 06:28 AM
I think it hangs because it's asking for username/password to access remote repository.
2 Posted by jwchung on 01 Mar, 2014 09:30 AM
Yes, that would be right. Sorry for my stupid question.
jwchung closed this discussion on 01 Mar, 2014 10:08 AM.
Feodor Fitsner re-opened this discussion on 01 Mar, 2014 05:15 PM
Support Staff 3 Posted by Feodor Fitsner on 01 Mar, 2014 05:15 PM
Quite the opposite - the question is valid :)
There is an approach for GitHub that could be implemented in AppVeyor: http://stackoverflow.com/questions/15672547/how-to-tag-a-commit-in-...
You can use PowerShell to call GitHub API with "personal access token": https://github.com/settings/applications ;)
4 Posted by jwchung on 02 Mar, 2014 02:54 AM
Hello, Feodor Fitsner
Thank you for your kindness.
The links you posted are helpful, but are depended on GitHub. This means that if I use another git server(service), it could be unavailable.
Currently, I have resolved this issue with just git commands as the following. The GitTagging target represents the two Exec tasks to push a git-tag to a remote server. Here, $(SemanticVersion) is a tag name and $(GitHubAccount) is my account on GitHub literally, which is formed as the "id:password" form.
The $(GitHubAccount) variable is given as an environment variable supported on AppVeyor. However, I'm not sure whether this is safe way to keep my git account secure. To be securer, I have used the /verbosity:minimal option of the MSBuild command not to be shown for a detail in build output of AppVeyor.
Support Staff 5 Posted by Feodor Fitsner on 02 Mar, 2014 05:43 AM
I agree, your method is more universal. I will create an article on how to "tag git repo during the build".
But since you are currently on GitHub :) I'd like recommend using Personal Access Tokens instead username:password:
1) Generate token: https://help.github.com/articles/creating-an-access-token-for-comma...
2) Use token in repo URL as
token:
(password is empty): https://help.github.com/articles/git-over-https-using-oauth-tokenRepo URL will look like:
https://token:@github.com/jwChung/Funz.git
Support Staff 6 Posted by Feodor Fitsner on 02 Mar, 2014 05:45 AM
And yes, token is considered as more safe way instead of account credentials.
7 Posted by jwchung on 02 Mar, 2014 08:20 AM
I didn't know that there is Personal API tokens which can be used in scripts and on the command line. Thank you for letting me know that.
The main issue of this thread would be resolved but I would like to tell you two more issues related with this thread. I think that you already know about it.
Pushing a tag(lightweight tag) in build process causes to queue other CI build on AppVeyor.
Queueing CI build with pushing tags seems to be appropriate, but IMO, in many cases, this scenario would be able to cause problems. There is an option to skip a build on AppVeyor but the option is not a solution in this case.
Anyone(anonymous authentication) can view my build outputs
I don't know that currently, as the version 2 is beta, this can happen, but this would have to be addressed.
By the way, the above issues aren't occurred in the current stable version(v1).
Support Staff 8 Posted by Feodor Fitsner on 02 Mar, 2014 03:55 PM
1. Have to think how to prevent this. Thanks for the note.
2. If it is a project with public repository it is visible to everyone. This is by design. To hide project from others its repository must be private.
- Feodor
9 Posted by jwchung on 03 Mar, 2014 12:16 AM
I see. Thank you again for your time. As this thread is resolved, I close this.
jwchung closed this discussion on 03 Mar, 2014 12:17 AM.