git pull
doesn't work with Jenkins for some reason.
I've updated some files on my local PC and pushed it to my Github. I can see the changes there. Then I run Jenkins build that has sh commands to pull from this repo and it says "Already up to date". Which is false as I clearly pushed new version to Github and if I go there and open up the file in my browser I can see the changes.
This only happens with Jenkins running git pull because if I connect to my VM and run git pull
myself it works fine and updates my files. Why does this happen?
My Jenkinsfile:
pipeline{
agent any
stages{
stage("build"){
steps{
echo 'build'
sh 'cd /var/atlassian/application-data/jira/scripts'
sh 'eval "$(ssh-agent -s)"'
sh 'ssh-add ~/.ssh/id_ed25519'
sh 'git pull [email protected]:mightyajax/scripts.git'
}
}
stage("test"){
steps{
echo 'test'
}
}
stage("deploy"){
steps{
echo 'deploy'
}
}
}
}