1
votes

I am trying to integrate jenkins running on EC2 with my code commit repository.

EC2 instance has ubuntu 14.04 running. I installed aws cli, then jenkins, I configured aws with IAM user key and secret having access to codecommit repository I want to build.

I foolowed this blog - http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-without-cli.html

but these commands are not working giving permission denied to .gitconfig

sudo -u jenkins git config --global credential.helper '!aws codecommit credential-helper $@'

I saw a similar question Access AWS CodeCommit from Jenkins running on EC2 (Ubuntu) but following that questions answer is also not working.

Jenkins is not able to clone my repository, giving this error
stderr: Host key verification failed. fatal: Could not read from remote repository.

I have been after this for a week now and I need to create a Continous Integration server for my MEAN application.

All I want to do is when there is a commit on master branch of repository

  1. EC2 server pulls the repository.
  2. Runs the grunt file
  3. Runs the script to upload to S3 the web application.
  4. Makes Pm2 to restart nodejs application.

Any other method full-proof and tested to create continuous integration for development server would be also appreciated.(A Lot!!)

1

1 Answers

1
votes

Well, I followed the answer again given in the question of which there is a link in my question, turns out jenkins was not getting permission of .ssh folder I created inside /var/lib/jenkins I used the following command to change permissions of .ssh folder

1] sudo chmod 777 .ssh
2] sudo chown -R jenkins .ssh

Then it started working.

Any other inputs regarding continuous integration which I am trying to workout would still be appreciated.

Thank You.