tag:help.appveyor.com,2012-11-13:/discussions/problems/9079-appveyor-secure-var-docker-login-doesnt-workAppVeyor: Discussion 2018-10-19T08:18:32Ztag:help.appveyor.com,2012-11-13:Comment/438438162017-10-23T23:42:54Z2017-10-23T23:42:54Zappveyor secure var docker login doesn't work<div><p>It seems that you run <code>docker</code> command in <code>cmd</code> mode but use environment variable notation in PowerShell syntax. You have you use <code>%variable%</code> (not <code>$env:variable</code>) in <code>cmd</code></p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/438438162017-10-24T01:06:27Z2017-10-24T01:06:27Zappveyor secure var docker login doesn't work<div><p>I don't know, if it don't specify is it in cmd mode?</p></div>monamimanitag:help.appveyor.com,2012-11-13:Comment/438438162017-10-24T01:43:03Z2017-10-24T01:43:03Zappveyor secure var docker login doesn't work<div><p>It is already in the <code>cmd</code> mode per what I see from your sample. If you just prefix command with <code>-</code> or <code>- cmd:</code>, it is in <code>cmd</code> mode and PowerShell environment variable syntax does not work. It is the same is of you try to use <code>$env:variable</code> on local Windows computer in <code>cmd</code> instead of PowerShell. More information on command line syntax is in respective part of <a href="https://www.appveyor.com/docs/build-configuration/#script-blocks-in-build-configuration">documentation</a>.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/438438162017-10-25T01:29:16Z2017-10-25T01:29:16Zappveyor secure var docker login doesn't work<div><p>ok thanks it solved my issue!<br>
But it seems now i have an other issue. lets say the content of a secure var is a username for example tipi to push the image in docker i need to do docker push tipi/myimage, it seems it is that is got confused with the secure var and couldn't push, because in the log i saw docker push ****/myimage. I changed it to ps: docker push tipy/myimage and it worked.<br>
so i gues there is a bug in the way secure var are handled.</p></div>monamimanitag:help.appveyor.com,2012-11-13:Comment/438438162017-10-25T01:57:01Z2017-10-25T01:57:01Zappveyor secure var docker login doesn't work<div><p>If secure variable value is got leaked to log, we replace it with <code>****</code> just to keep your secrets invisible. This does not affect what was actually passed into command. If you provide build configuration and YAML format and and build logs for failed build we could help more.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/438438162017-10-25T03:00:14Z2017-10-25T03:00:14Zappveyor secure var docker login doesn't work<div><p>AppVeyor doesn't use the "context" while replacing secure variable value in the build log. If secure variable contains <code>hello</code> all <code>hello</code> occurrences found in the log will be masked. We bet on the fact secure variable contains something password-like, e.g. <code>mHs0$5A#2</code></p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/438438162017-10-25T23:27:54Z2017-10-25T23:27:54Zappveyor secure var docker login doesn't work<div><p>Thanks, now that I changed to - ps: docker push tipy/myimage the command succeed. Where - docker push tipy/myimage didn't.</p>
<p>so I have a good work around.</p></div>monamimani