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/
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
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
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***" } }
create/modify ssh config file
host git-codecommit.*.amazonaws.com user apk******* identityfile /var/lib/jenkins/.ssh/id_rsa stricthostkeychecking no
where apk*** value of key id retrieved in step 3
- copy or move file /var/lib/jenkins/.ssh/config (or wherever jenkins installed on ec2 instance)
- ensure 'jenkins' user has 0600 permissions /var/lib/jenkins/.ssh directory
- create jenkins job described in blog post first used. repository url, however, enter ssh url instead. (no credentials needed)
Comments
Post a Comment