ssh-add, Gitlab CI/CD with alpine image

Problem

Trying to use the usual way of adding Gitlab’s key to the ssh agent, is not working in alpine image (but it works in debian/ubuntu), and you get the following error message:

 - ssh-add <(echo "$GITLABCICD_PRIVATE_KEY")
/bin/sh: syntax error: unexpected "("

Solution

Try to use the following instead:

  - echo "$GITLABCICD_PRIVATE_KEY" | ssh-add -