Codefresh notes

Submitted by code_admin on Sat, 12/08/2018 - 09:51

Configuring my cloud server to use

Generate a codefresh public/private key pair on catness

  1. ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa_codefresh

CHANGED

  1. ssh-keygen -t ed25519  -f ~/.ssh/id_rsa_codefresh

Setup codefreshrunner user on my server and give it permission to run docker:

  1. sudo adduser codefreshrunner
  2. sudo usermod -a -G docker codefreshrunner

Login as that user and check they can run docker commands

  1. mkdir ~/.ssh
  2. echo KEY > ~/.ssh/authorized_keys

Logout and check login works using key (run on catness)

  1. ssh -o "IdentitiesOnly=yes" -i ~/.ssh/id_rsa_codefresh codefreshrunner@metcarob.com -p XXXX

On catness run

  1. cat ~/.ssh/id_rsa_codefresh | tr '\n' ','

Copy and past this into the SSH_KEY value in the pipeline.

DEBUG

Connect from catness:

  1. ssh codefreshrunner@metcarob.com -p ${SSH_PORT} -i /home/robert/.ssh/id_rsa_codefresh

Connect via rdocker:

  1. docker run --rm -e SSH_KEY="${SSH_KEY}" -e SPLIT_CHAR="${SPLIT_CHAR}" -e SSH_PORT="${SSH_PORT}" --entrypoint /bin/bash codefresh/remote-docker -c "rdocker codefreshrunner@metcarob.com ls /"

BAD SUBSTITUTION on a stage - did you copy variables from a different project? different projects need different variables. Check all variables for this stage are setup

RJM Article Type
Work Notes