I’m working on deploying a static web application to an existing nginx web server and I can’t get past the Copy to Server
step of my build.
Here’s my current config.yml
defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:8.9
version: 2
jobs:
build:
<<: *defaults
steps:
# intentionally skipped, since this all works.
deploy_storybook:
<<: *defaults
steps:
- checkout
- add_ssh_keys
- run:
name: NPM Install
command: npm install
- run:
name: Output Files
command: npm run storybook-build
- run:
name: Copy to Server
command: |
echo 'sub.domain.com ecdsa-sha2-nistp256 ~/.ssh/id_ecdsa.pub' >> ~/.ssh/known_hosts
echo 'sub.domain.com ssh-rsa ~/.ssh/id_rsa.pub' >> ~/.ssh/known_hosts
sudo scp -r ~/repo/.storybook-dist/. deploy@sub.domain.com:/home/deploy/sub.domain.com/public_html
workflows:
version: 2
build-and-deploy:
jobs:
- build
- deploy_storybook:
filters:
branches:
only:
- development
requires:
- build
As you can see, I’ve at least attempted everything mentioned here and here.
Note: I’ve tried many others, but since I’m new here I’m only allowed to link to two.
I’ve SSH’d from my machine to the web server to verify I could connect. From the server I ran the command ssh-keygen -t edcsa
and ssh-keygen -t rsa
. I’ve taken the raw files and added both to my CircleCi settings. I’ve then taken the .pub
output from both and used those in the echo 'sub.domain.com ecdsa-sha2-nistp256 ' >> ~/.ssh/known_hosts
.
I also added the command ssh-keyscan sub.domain.com
into my config and used the output from that in the command.
Regardless of what I’ve done, I’m constantly receiving the error:
The authenticity of host 'sub.domain.com (0.0.0.0)' can't be established.
ECDSA key fingerprint is SO:ME:FI:NG:ER:PR:IN:T.
Are you sure you want to continue connecting (yes/no)?
I feel like this should be a pretty straight forward process, but I can’t seem to make it work. I’ve noticed that all of the documentation seems to point back to the same thing and I can’t seem to crack it.
Any ideas are greatly appreciated. I’m sure I’m just overlooking something simple somewhere.
Update:
Using links off this post, I’ve also tried modifying my scp
command to include:
-o StrictHostKeyChecking=no
I’ve also updated the SSH keys in my settings to use no hostname.
Neither of those worked.
Another Update:
Just to be sure I wasn’t doing anything wrong, I generated ANOTHER set of keys. This time, I made sure to use ECDSA (since that’s what the prompt is looking for) and I made sure to use my username (deploy@sub.domain.com
). I added the private key to my CircleCi config both with and without a hostname and then added the public key onto my web server.
Still no dice.
I’ve now invested a lot of time into just trying to make scp work, maybe I should just throw this in a container and do it that way. Just seems like a really heavy handed way to run a simple website with a couple pages.