Pushing local git-tag to remote sever

jwchung's Avatar

jwchung

01 Mar, 2014 05:57 AM

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
  1. Support Staff 1 Posted by Feodor Fitsner on 01 Mar, 2014 06:28 AM

    Feodor Fitsner's Avatar

    I think it hangs because it's asking for username/password to access remote repository.

  2. 2 Posted by jwchung on 01 Mar, 2014 09:30 AM

    jwchung's Avatar

    Yes, that would be right. Sorry for my stupid question.

  3. jwchung closed this discussion on 01 Mar, 2014 10:08 AM.

  4. Feodor Fitsner re-opened this discussion on 01 Mar, 2014 05:15 PM

  5. Support Staff 3 Posted by Feodor Fitsner on 01 Mar, 2014 05:15 PM

    Feodor Fitsner's Avatar

    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 ;)

  6. 4 Posted by jwchung on 02 Mar, 2014 02:54 AM

    jwchung's Avatar

    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.

      <Target Name="GitTagging">
        <Exec Command="git tag $(SemanticVersion)" />
        <Exec Command="git push --tags --repo https://$(GitHubAccount)@github.com/jwChung/Funz.git" />
      </Target>
    
  7. Support Staff 5 Posted by Feodor Fitsner on 02 Mar, 2014 05:43 AM

    Feodor Fitsner's Avatar

    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-token

    Repo URL will look like: https://token:@github.com/jwChung/Funz.git

  8. Support Staff 6 Posted by Feodor Fitsner on 02 Mar, 2014 05:45 AM

    Feodor Fitsner's Avatar

    And yes, token is considered as more safe way instead of account credentials.

  9. 7 Posted by jwchung on 02 Mar, 2014 08:20 AM

    jwchung's Avatar

    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.

    1. 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.

    2. 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).

  10. Support Staff 8 Posted by Feodor Fitsner on 02 Mar, 2014 03:55 PM

    Feodor Fitsner's Avatar

    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

  11. 9 Posted by jwchung on 03 Mar, 2014 12:16 AM

    jwchung's Avatar

    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.

    I see. Thank you again for your time. As this thread is resolved, I close this.

  12. jwchung closed this discussion on 03 Mar, 2014 12:17 AM.

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

Recent Discussions

21 Aug, 2019 11:06 PM
21 Aug, 2019 02:08 PM
21 Aug, 2019 01:37 PM
21 Aug, 2019 10:21 AM
21 Aug, 2019 09:10 AM

 

21 Aug, 2019 05:56 AM
21 Aug, 2019 03:08 AM
20 Aug, 2019 11:33 PM
20 Aug, 2019 08:07 PM
20 Aug, 2019 05:50 PM
20 Aug, 2019 12:35 PM