Commit 23f37b9b authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Test config pour utiliser une clé SSH passée via une variable.

parent 9a2feda6
Loading
Loading
Loading
Loading
Loading
+33 −0
Changes for .gitlab-ci.yml: 33 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -5,6 +5,39 @@ stages:
  - build
  - deploy

before_script:
  ##
  ## Install ssh-agent if not already installed, it is required by Docker.
  ## (change apt-get to yum if you use an RPM-based image)
  ##
  - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'

  ##
  ## Run ssh-agent (inside the build environment)
  ##
  - eval $(ssh-agent -s)

  ##
  ## Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
  ## We're using tr to fix line endings which makes ed25519 keys work
  ## without extra base64 encoding.
  ## https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556
  ##
  - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null

  ##
  ## Create the SSH directory and give it the right permissions
  ##
  - mkdir -p ~/.ssh
  - chmod 700 ~/.ssh

  ##
  ## Optionally, if you will be using any Git commands, set the user name and
  ## and email.
  ##
  #- git config --global user.email "user@example.com"
  #- git config --global user.name "User name"
   
test:
  stage: test
  script: echo "Running tests"