Gitlab. Ошибка в pipeline — ssh: command not found
Ошибка при выполнении pipeline:
$ chmod 400 $SSH_KEY $ ssh -o StrictHostKeyChecking=no -i $SSH_KEY root@10.10.10.244 " docker login -u $REGISTRY_USER -p $REGISTRY_PASS && docker ps -aq | xargs docker stop | xargs docker rm && docker run -d -p 5000:5000 $IMAGE_NAME:$IMAGE_TAG" /usr/local/bin/bash: line 128: ssh: command not found Cleaning up project directory and file based variables00:03 ERROR: Job failed: exit code 1
Помогло использование такого .gitlab-ci.yml:
default: tags: - ssh stages: - test deploy: stage: test before_script: - 'command -v ssh-agent >/dev/null || ( apk add --update openssh )' - eval $(ssh-agent -s) - chmod 400 $SSH_KEY - mkdir -p ~/.ssh - chmod 400 ~/.ssh script: - ssh -o StrictHostKeyChecking=no -i $SSH_KEY root@10.10.10.244 " hostname && docker ps -aq | xargs docker stop | xargs docker rm && docker run hello-world"