# Day 13: Continuous Integration(CI) Setup

* **Learn**: Install Jenkins (docker run -p 8080:8080 jenkins/jenkins), create pipelines.
* **Task**: Set up Jenkins, create a pipeline to build the User Service (Maven).

### Daily Tasks :&#x20;

* Jira update
* jenkins setup via Docker
* Setting up CI pipeline

Since, I am using jenkins inside a docker, i am facing some issues with the setup. Hence, started github actions and able to setup CI pipeline successfully.

### setting up Jenkins via Docker

* Run jenkins as a docker container with below command

```
docker run -d \
  --name jenkins \
  -p 8082:8080 \
  -v jenkins_home:/var/jenkins_home \
  -v /var/run/docker.sock:/var/run/docker.sock \
  --restart unless-stopped \
  jenkins/jenkins:lts
```

* we can get initial password to login to the jenkins via below command

`docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword`  --> To get initial password of jenkins

* we can access jenkins at  \`<http://localhost:8082>\`&#x20;
* we can choose install suggested plugins option
* username 'admin' password \<whatever we got from above command\` and email \<our-choice>
* save and finish

Configure Github with jenkins

* Go to settings of your github account and generate PAT(personal access token) .
* Install github integration plugin in jenkins
* Go to Manage Jenkins > Configure System > GitHub Servers.
* Add GitHub Server:

  * Name: GitHub
  * API URL: <https://api.github.com>
  * Credentials: Add > Jenkins
    * Kind: Secret text
    * Secret: Paste GitHub token
    * ID: github-token
    * Description: GitHub Token for Ecomm
    * Test connection (Should succeed)

<figure><img src="/files/17Nikq2wmPHh77A5oPMD" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/5xpQSJVJeldgjgC2Z4Yy" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/IfYsm0yogQhzYow9B06x" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/hTV66EPxshrKx2T091oX" alt=""><figcaption></figcaption></figure>

Here you are supposed to see nodejs, if you are not able to see then it means we need to install that particular software/package as a plugin then u can able to see this option here.

<figure><img src="/files/zEZ9oKPhX3qyjDyByIcv" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/LUMzExENGA9UtojO02Fh" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/SEho5cqVXFQ9tJ7W1pIM" alt=""><figcaption></figcaption></figure>

<https://dashboard.ngrok.com/get-started/your-authtoken>  Since, github webhooks doesn't allow localhost. Hence, we are using ngrok to bypass the connection


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://charan-techjourney.gitbook.io/charan-techjournal/50-days-of-devops-ecommerce-microservices/project-daily-tasks/day-13-continuous-integration-ci-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
