amazon web services - Access AWS CodeCommit from Jenkins running on EC2 (Ubuntu) -


i'm trying integrate jenkins aws codecommit. jenkins running on aws ec2 instance ubuntu 14.04.

i followed blogpost: http://blogs.aws.amazon.com/application-management/post/tx1c8b98xn0af2e/integrating-aws-codecommit-with-jenkins

the problem is, sudo -u jenkins aws configure isn't executed because jenkins user has no permissions.

what do?

the following commands aren't working well:

sudo -u jenkins git config --global credential.helper '!aws codecommit credential-helper $@' sudo -u jenkins git config --global credential.usehttppath true sudo -u jenkins git config --global user.email "me@mycompany.com" sudo -u jenkins git config --global user.name "myjenkinsserver" 

what rights jenkins user need?

thanks in advance.

i able achieve integration using ssh. extent, followed these instructions: setting codecommit

assuming jenkins home /var/lib/jenkins/

  1. create ssh key on jenkins ec2 instance (/var/lib/jenkins/.ssh/id_rsa)

    ssh-keygen -b 2048 -t rsa -f /var/lib/jenkins/.ssh/id-rsa -a -n 
  2. upload public key iam user (iam user must have codecommit access)

    aws iam upload-ssh-public-key --user-name <username> --ssh-public-key-body file:///var/lib/jenkins/.ssh/id_rsa.pub 
  3. collect sshpublickeyid when upload key

    {  "sshpublickey": {  "username": "jenkins",  "status": "active",  "sshpublickeybody": "ssh-rsa <rsa-key> <host>\n",  "uploaddate": "2015-09-02t19:18:24.309z",  "fingerprint": "xxx",  "sshpublickeyid": "apk***"  } } 
  4. create/modify ssh config file

    host git-codecommit.*.amazonaws.com   user apk*******   identityfile /var/lib/jenkins/.ssh/id_rsa   stricthostkeychecking no 
  5. where apk*** value of key id retrieved in step 3

  6. copy or move file /var/lib/jenkins/.ssh/config (or wherever jenkins installed on ec2 instance)
  7. ensure 'jenkins' user has 0600 permissions /var/lib/jenkins/.ssh directory
  8. create jenkins job described in blog post first used. repository url, however, enter ssh url instead. (no credentials needed)

Comments

Popular posts from this blog

javascript - How to process users in one specific order using map o each function? -

java - Two interface have same method name with different return type -

javascript - Linking from page A to a specific iframe on page B -