toradex / vscode-torizon-templates

VS Code Torizon Integrated Development Environment Templates
MIT License
15 stars 20 forks source link

Facing issue with Torizon in createDockerComposeProduction.ps1 file to login to docker registry #221

Open mdkhaledibnhassan opened 1 month ago

mdkhaledibnhassan commented 1 month ago

Hi In Torizon below command does not work in createDockerComposeProduction.ps1 file during CI/CD in gitlab

Write-Output "$psswd" | docker login $registry -u $dockerLogin --password-stdin

I have to use

docker login -u $dockerLogin -p "$env:DOCKER_PSSWD" $registry

microhobby commented 2 weeks ago

Hey @mdkhaledibnhassan thanks for the report, I was not able to reproduce this on my side. Do you have some logs to share?

griloHBG commented 1 week ago

Hi @microhobby!

FYI @mdkhaledibnhassan followed up on their Toradex Community thread [1]

the issue was not fixed and I found the cause of the issue. I think I fixed it in correct way. In current code there is no way to provide password when it will run in gitlab CI/CD. We have to store it in gitlab variables as mentioned in Toradex guideline but later did not update that line to use that variable.

Default code assumes that user will enter password in console which is not true for CI/CD. Nobody can’t input.

[1] https://community.toradex.com/t/faced-issue-to-login-in-createdockercomposeproduction-task/24673/10