I have created a bitbucket pipeline under a repository and i have generated the SSH Keys and have updated the authorized_keys file in the host. Delivery part is carried by rsync, during the deployment phase i'm getting the following error.
rsync -zrSlh --stats --exclude-from=deployment-exclude-list.txt $BITBUCKET_CLONE_DIR/ $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH;
Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(235) [sender=3.1.2]
My bitbucket-pipelines.yml as follows,
image: php:7.2.1-fpm
pipelines:
default:
- step:
caches:
- composer
script:
- apt-get update
- apt-get install git -y
- export APP_ENV=testing
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
- step:
name: Deploy to test
deployment: test
script:
- apt-get update
- apt-get install ssh -y
- apt-get install rsync -y
- rsync -zrSlh --stats --exclude-from=deployment-exclude-list.txt $BITBUCKET_CLONE_DIR/ $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH;
According to the documentation this yml should work, but i'm getting above error, your help is really appreciated and welcome.
This solved it for me:
https://bitbucket.org/your-org/your-app/admin/addon/admin/pipelines/ssh-keys
myapp.com
and tap Fetch
Add
The host address and fingerprint will be added to the bottom of the section
Settings > Ssh Key
Add your remote server host/ip number, fetch and save the fingerprint.
See the step 2 https://confluence.atlassian.com/bitbucket/use-ssh-keys-in-bitbucket-pipelines-847452940.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With