I am trying to use an added ssk key to deploy files to a remote server using rsync. This worked under CircleCI 1.0, but the same key was not working after I tried to migrate our relatively simple config to 2.0. I’m using the
add_ssh_keys command as described elsewhere, and I’ve tried generating a new key and adding through the CircleCI project settings to get the fingerprint. Using a node container, but not certain if that’s relevant.
What I’m observing in the build output is the fingerprint of the added key and the fingerprint of the key being used don’t match. I’m not certain if the specific key needs to be specified somewhere and, if it does, not sure how to do that.
Our .circleci/config.yml files looks like this:
version: 2 jobs: build: docker: - image: circleci/node:10-browsers-legacy branches: only: - develop steps: - checkout - run: sudo apt install rsync - run: npm set prefix=/home/circleci/npm && echo 'export PATH=$HOME/circleci/npm/bin:$PATH' >> /home/circleci/.bashrc - run: npm install webpack-cli -g - run: npm install - run: npm run build - add_ssh_keys: fingerprints: - "0a:7d:b4:no:tr:ea:ll:yt:he:ss:hf:in:ge:rp:ri:nt" - run: rsync -rvlz -e 'ssh -p 2222' --force dist/ sw firstname.lastname@example.org:/path/to/deployment/folder