tag:help.appveyor.com,2012-11-13:/discussions/problems/123-pushing-local-git-tag-to-remote-severAppVeyor: Discussion 2018-10-19T08:16:30Ztag:help.appveyor.com,2012-11-13:Comment/318708022014-03-01T06:28:37Z2014-03-01T06:28:37ZPushing local git-tag to remote sever<div><p>I think it hangs because it's asking for username/password to
access remote repository.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/318708022014-03-01T09:30:21Z2014-03-01T09:30:21ZPushing local git-tag to remote sever<div><p>Yes, that would be right. Sorry for my stupid question.</p></div>jwchungtag:help.appveyor.com,2012-11-13:Comment/318708022014-03-01T17:15:42Z2014-03-01T17:15:42ZPushing local git-tag to remote sever<div><p>Quite the opposite - the question is valid :)</p>
<p>There is an approach for GitHub that could be implemented in
AppVeyor: <a href=
"http://stackoverflow.com/questions/15672547/how-to-tag-a-commit-in-api-using-curl-command">
http://stackoverflow.com/questions/15672547/how-to-tag-a-commit-in-...</a></p>
<p>You can use PowerShell to call GitHub API with "personal access
token": <a href=
"https://github.com/settings/applications">https://github.com/settings/applications</a>
;)</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/318708022014-03-02T02:54:23Z2014-03-02T02:55:40ZPushing local git-tag to remote sever<div><p>Hello, Feodor Fitsner</p>
<p>Thank you for your kindness.</p>
<p>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.</p>
<p>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.</p>
<p>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 <a href=
"http://msdn.microsoft.com/en-us/library/ms164311.aspx">the
/verbosity:minimal option</a> of the MSBuild command not to be
shown for a detail in build output of AppVeyor.</p>
<pre>
<code> <Target Name="GitTagging">
<Exec Command="git tag $(SemanticVersion)" />
<Exec Command="git push --tags --repo https://$(GitHubAccount)@github.com/jwChung/Funz.git" />
</Target></code>
</pre></div>jwchungtag:help.appveyor.com,2012-11-13:Comment/318708022014-03-02T05:43:56Z2014-03-02T05:43:56ZPushing local git-tag to remote sever<div><p>I agree, your method is more universal. I will create an article
on how to "tag git repo during the build".</p>
<p>But since you are currently on GitHub :) I'd like recommend
using Personal Access Tokens instead username:password:<br>
1) Generate token: <a href=
"https://help.github.com/articles/creating-an-access-token-for-command-line-use">
https://help.github.com/articles/creating-an-access-token-for-comma...</a><br>
2) Use token in repo URL as <code>token:</code> (password is
empty): <a href=
"https://help.github.com/articles/git-over-https-using-oauth-token">
https://help.github.com/articles/git-over-https-using-oauth-token</a></p>
<p>Repo URL will look like:
<code>https://token:@github.com/jwChung/Funz.git</code></p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/318708022014-03-02T05:45:23Z2014-03-02T05:45:35ZPushing local git-tag to remote sever<div><p>And yes, token is considered as more safe way instead of account
credentials.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/318708022014-03-02T08:20:19Z2014-03-02T08:24:30ZPushing local git-tag to remote sever<div><p>I didn't know that there is <a href=
"https://github.com/blog/1509-personal-api-tokens">Personal API
tokens</a> which can be used in scripts and on the command line.
Thank you for letting me know that.</p>
<p>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.</p>
<ol>
<li>
<p><strong>Pushing a tag(lightweight tag) in build process causes
to queue other CI build on AppVeyor.</strong><br>
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 <a href=
"http://www.appveyor.com/docs2/how-to/skip-build">to skip a
build</a> on AppVeyor but the option is not a solution in this
case.</p>
</li>
<li>
<p><strong>Anyone(anonymous authentication) can view my build
outputs</strong><br>
I don't know that currently, as the version 2 is beta, this can
happen, but this would have to be addressed.</p>
</li>
</ol>
<p>By the way, the above issues aren't occurred in the current
stable version(v1).</p></div>jwchungtag:help.appveyor.com,2012-11-13:Comment/318708022014-03-02T15:55:15Z2014-03-02T15:55:15ZPushing local git-tag to remote sever<div><ol>
<li>
<p>Have to think how to prevent this. Thanks for the note.</p>
</li>
<li>
<p>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.</p>
</li>
</ol>
<ul>
<li>Feodor</li>
</ul></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/318708022014-03-03T00:16:55Z2014-03-03T00:16:55ZPushing local git-tag to remote sever<div><blockquote>
<p>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.</p>
</blockquote>
<p>I see. Thank you again for your time. As this thread is
resolved, I close this.</p></div>jwchung