2

i have a testing stage in my pipeline which needs to install some private requirements from bitbucket. following is my pipeline code.

pipeline {
    agent any
    environment {
         APPLICATION = 'connect'

     }
         stage('clone repository') {
             steps {
                 echo "env.DOCKER_IMAGE_TAG"
                 checkout scm
             }
         }
         stage('Test') {
            steps {
                script {
                    sh 'virtualenv env -p python3.5'
                    sh '. env/bin/activate'
                    sh "env/bin/pip install -r requirements/private.txt"
                    sh "env/bin/pip install -r requirements/${env.ENVIRONMENT}.txt"
                    sh 'env/bin/python3.5 manage.py test --pattern="test_*.py'
                }
            }
         }
}

i have pasted ssh private and public keys which is being used by bitbucket in /var/lib/jenkins/.ssh/ and i have also configured publish over SSH in following way.

enter image description here

but upon running the job i am getting following error. enter image description here

i think i am unable to setup ssh keys properly. Please correct me where i am doing wrong in setting up the keys.

Shoaib Iqbal
  • 2,420
  • 4
  • 26
  • 51
  • See here: https://stackoverflow.com/questions/15174194/jenkins-host-key-verification-failed You will need to get your jenkins user to trust the bitbucket server, as it has never seen the key of the bitbucket host. When running git/ssh interactively it usually asks weather or not a key should be trusted. When running this non-interactively, it just fails. – winston Jan 07 '19 at 10:54

0 Answers0