9
votes

I have a repository in a [company hosted] GitHub enterprise site that I need to integrate within a CI/CD pipeline in AWS using the CodePipeline service. The CodePipeline service then will connect with a Jenkins Service running in an EC2 instance. I am following this AWS documentation to do this.

Note that this is an enterprise GitHub repo and not hosted on GitHub.com.

I am unable to connect to the GitHub Enterprise site in the "Create a pipeline" wizard. Selecting GitHub as a source only lets me connect to GitHub.com, and not to my organization's enterprise site.

How do I connect to the enterprise GitHub site so that I can add the repo as a source for my codepipeline?

4
where is your GitHub enterprise hosted?Sid Malani
Its hosted within my organization, on my organization's own hardware.sidx64
Looks like there is indeed no support for GitHub enterprise in Pipeline although there is one for CodeBuild. You could potentially use Code Build to bridge the gap. In the appspec.yaml you can write AWS or other commands to achieve this.Sid Malani
Finally there's an official integration: aws.amazon.com/about-aws/whats-new/2020/09/…Pedreiro

4 Answers

3
votes

UPDATE: An integration was finally released for github enterprise to work with AWS Codepipeline. Please see this answer by Pedreiro


As Sid Malani said in the comments, there's no straightforward or direct way to use a privately hosted GitHub Enterprise Repository in AWS CodePipeline.

One way would be to use CodeBuild, which allows to add custom github repositories which can then be used in CodePipeline. This, however, should only be considered as a stop-gap solution.

Thank you Sid Malani for the alternative strategy

2
votes

I doubt AWS will ship this feature anytime soon (hopefully I eat my words) since the workaround is well-documented and works fine. The gist of it can be found here, which I'll summarize as follows:

  1. Create a CodeBuild project (which can take GitHub Enterprise as a source) which essentially just listens to a push event (webhook) of your development or master branch and outputs a .zip file of the source-code into an S3 bucket.
  2. Use the S3 bucket as the source of your CodePipeline.
0
votes

There is a way to integrate 3rd party Git repos with AWS CodePipeline. AWS suggested the following process. It used S3 buckets and API Gateways and Lambdas to connected Github enterprise repos to CodePipeline. It's not ideal but it can work.

Unofficial: I've heard CodePipeline support for Github Enterprise will be out second half of 2019.