CodePipeline with private repo

Hi all,

I’m trying to setup a CodePipeline but with a few difficult things.

  1. The GitLab server is private, AWS doesn’t have access
  2. To fix that, we build the docker on GitLab and push it to ECR

That is working, working container is in ECR. But now we need an appspec and taskdef for the pipeline. It can’t be fetched from the repo (because it’s an internal server). What is the next best option to host these files? I tried S3, but that doesn’t seem to be working.

Maybe anyone here has experience with this?

Hi, you can create a code deploy deloyment using aws cli from gitlab, I do the same with github actions. Trick is to also register ecs task def after you push to ECR then use the taskdef ARN in appspec, so it should be like

  1. Build and push to ECR
  2. Fill your taskdef with correct image, tags etc
  3. Register the task def
  4. Get the registered taskdef arn and add that to appspec
  5. Use the now complete appspec revision with codedeploy

CodePipeline → appspec → taskdef → ecr image

Sorry am on mobile

There may be clone plugins for your server to clone the repo to codecommit as long as it has internet access so your pipe can grab from code commit.

That way it mirrors the repo on every push.

Another way we’ve solved this is to setup a push mirror in GitLab to CodeCommit, and then hook the CodePipeline up to that.

Comes with the usual limitations around how often pushes can be triggered, but it’s worked well for us.

We just keep our TaskDef and AppSpec in a separate repo (AWS CodeCommit).