Posts

Showing posts with the label Continuous Integration

Authenticate Jenkins CI For Github Private Repository

Answer : Perhaps GitHub's support for deploy keys is what you're looking for? To quote that page: When should I use a deploy key? Simple, when you have a server that needs pull access to a single private repo. This key is attached directly to the repository instead of to a personal user account. If that's what you're already trying and it doesn't work, you might want to update your question with more details of the URLs being used, the names and location of the key files, etc. Now for the technical part: How to use your SSH key with Jenkins? If you have, say, a jenkins unix user, you can store your deploy key in ~/.ssh/id_rsa . When Jenkins tries to clone the repo via ssh, it will try to use that key. In some setups, you cannot run Jenkins as an own user account, and possibly also cannot use the default ssh key location ~/.ssh/id_rsa . In such cases, you can create a key in a different location, e.g. ~/.ssh/deploy_key , and configure ssh ...

CircleCI - Different Value To Environment Variable According To The Branch

Answer : The question is almost 2 years now but recently I was looking for similar solution and I found it. It refers to CircleCI's feature called Contexts (https://circleci.com/docs/2.0/contexts/). Thanks to Contexts you can create multiple sets of environment variables which are available within entire organisation. Then you can dynamically load one of the sets depending of workflows' filters property. Let me demonstrate it with following example: Imagine you have two branches and you want each of them to be deployed into different server. What you have to do is: create two contexts (e.g. prod-ctx and dev-ctx ) and define SERVER_URL environment variable in each of them. You need to log into CircleCI dashboard and go to "Settings" -> "Contexts". in your .circleci/config.yml define job's template and call it deploy : deploy: &deploy steps: - ... define workflows: workflows: version: 2 deploy: jobs: - dep...

AccessDenied For ListObjectsV2 Operation For S3 Bucket

Answer : I'm not sure the accepted answer is actually acceptable , as it simply allows all operations on the bucket. Also the Sid is misleading... ;-) This AWS article mentions the required permissions for aws s3 sync . This is how a corresponding policy looks like: { "Version": "version_id", "Statement": [ { "Sid": "AllowBucketSync", "Effect": "Allow", "Action": [ "s3:GetObject", "s3:PutObject", "s3:ListBucket" ], "Resource": [ "arn:aws:s3:::BUCKET-NAME", "arn:aws:s3:::BUCKET-NAME/*" ] } ] } Try to update your bucket policy to: { "Version": "version_id", "Statement": [ { "Sid": "AllowPublicRead", "Effect": "Allow", ...