Home:ALL Converter>GitLab CI/CD SSH Session Hangs in Pipeline

GitLab CI/CD SSH Session Hangs in Pipeline

Ask Time:2019-09-21T14:31:39         Author:confusedandamused

Json Formatter

I am using GitLab CI/CD to build and push a docker image to my private GitLab registry.

I am able to successfully SSH into my server from the pipeline runner, but any commands passed into the SSH session doesn't run.

I am trying to pull the latest image from my GitLab container registry, run it, and exit the session to gracefully (successfully) pass the data to my pipeline.

The command I am running is:

ssh -t [email protected] "docker pull registry.gitlab.com/user/project:latest & docker run project:latest"

The above command connects me to my server, and I see the typical welcome message, but the session hangs and no commands are ran.

I have tried using the heredoc format to pass in multiple commands at once, but I can't get a single command to work.

Any advice is appreciated.

Author:confusedandamused,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/58037861/gitlab-ci-cd-ssh-session-hangs-in-pipeline
yy