Member-only story
Using a private GitHub repository with a “GitHub Personal Access Token” in the Jenkins pipeline that runs automatically the development stage via Amazon ECR and Docker container.
In this article, we will see how to use the private GitHub repository with a “GitHub Personal Access Token” in the Jenkins pipeline that runs the development stage via Amazon ECR(Elastic Container Registry) and Docker container automatically. For this, we will create a private GitHub repository, then we’ll add the JavaScript application to it for testing, and then we will create a Dockerfile that will build and run the code (using “yarn” and “node” in the Node JS runtime environment that is used to run JavaScript codes), later we will create a “GitHub Personal Access Token”, and finally we will integrate this token into the Jenkins pipeline and use it in Jenkins pipeline that it will run automatically the development stage using Amazon ECR and Docker container. We will do it all step by step.

Topics we will cover:
1. Creating a private GitHub repository.
2. Adding a Nodejs application to the private GitHub repository for testing.
3. Creating a “GitHub Personal Access Token” on GitHub.
4. Writing a Dockerfile that will build and run the code and description of the Dockerfile.
5. Preparing a Jenkins pipeline and integrating this token into the Jenkins pipeline.
5. a. As a prerequisite, Installing the Jenkins server from the Terraform file.
5. b. Installing necessary plugins in Jenkins.
5. c. Preparing a Jenkinsfile.