Jenkins and github

I have a jenkins server with the github plugin to trigger every time a change is made to the repo.
I have the private key and the public key loaded into the github repo.
The job is configured as:
Repository URL git@github.com:xxx/repo.git

I didn’t enter the URL in the top part of the job.
One of the tasks I have Jenkins do is:
cd /var/www/html/ && git pull origin master
But whenever I make a change to the repo it is not being triggered and I don’t know why.

  • Deploy a git tag to Amazon Elastic Beanstalk
  • Deploy only specified files to AWS Elastic Beanstalk
  • amazon beanstalk ec2 instance current git sha
  • AWS - 'Failed to get bucket name' when doing git aws.push
  • “ValueError: too many values to unpack” while deploying Django app to AWS
  • Why might AWS Elastic Beanstalk continue serving an old app version?
  • When I run the build manually I get:
    [Unit_Test] $ /bin/sh -xe /tmp/hudson1951363618156731736.sh
    + cd /var/www/html/
    + git pull origin master
    ERROR: Repository not found.
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.
    Build step ‘Execute shell’ marked build as failure
    Email was triggered for: Failure – Any
    Sending email for trigger: Failure – Any
    Sending email to: xx@xx.com
    Finished: FAILURE

  • Undo git rm -r f (ambiguous argument 'HEAD') before first commit
  • Diff between commits in Visual Studio 2015 using git
  • Error “Failed connect to github.com”
  • Git ignore subfolders but not the files in a folder
  • Why I see in Git an added folder as a unique file
  • EGit - “Replace With Commit…” doesn't work as excepted
  • 2 Solutions collect form web for “Jenkins and github”

    Don’t just use Jenkins as a shell script executor:

    • Use the Git plugin and configure it correctly. With this you should be able to pull code
    • Use the GitHub plugin and check the Build when a change is pushed to GitHub and add the hook to your repo on GitHub so Jenkins gets notified whenever a change is pushed
    • Under the point Pre Steps add Execute shell and prepare the environment for the actual build

    Had to add polling with * * * * * to get it to work.

    Git Baby is a git and github fan, let's start git clone.