# Jenkins 시작하기

## homebrew

### 설치하기

```bash
$ brew install jenkins
```

```
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 3 taps (homebrew/cask-versions, homebrew/core and homebrew/cask).
==> New Formulae
cava
==> Updated Formulae
Updated 71 formulae.
==> Updated Casks
Updated 33 casks.

==> Downloading https://ghcr.io/v2/homebrew/core/jenkins/manifests/2.321
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/jenkins/blobs/sha256:db3a6fba65069c5e9be3
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:db3a6
######################################################################## 100.0%
==> Pouring jenkins--2.321.all.bottle.tar.gz
==> Caveats
Note: When using launchctl the port will be 8080.

To restart jenkins after an upgrade:
  brew services restart jenkins
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/openjdk@11/bin/java -Dmail.smtp.starttls.enable=true -jar /usr/local/opt/jenkins/libexec/jenkins.war --httpListenAddress=127.0.0.1 --httpPort=8080
==> Summary
🍺  /usr/local/Cellar/jenkins/2.321: 8 files, 73.5MB
```

### 젠킨스 실행하기

```bash
$ brew services start jenkins
==> Successfully started `jenkins` (label: homebrew.mxcl.jenkins)
```

실행이 성공적으로 되고 나면, <http://localhost:8080> 을 실행하면 젠킨스 웹 페이지가 나온다.

![jenkins\_password](https://1681454910-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M26jG1i8u0kjXgtGdVt-887967055%2Fuploads%2Fgit-blob-1986b39f9ed1bc5030c8d6bcb49ede9793fdd433%2Fjenkins_password.png?alt=media)

최초 실행시 관리자 비밀번호를 입력하라고 알려주며, 빨강색 경로의 파일에 비밀번호를 입력하면된다.

![jenkins\_plugin](https://1681454910-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M26jG1i8u0kjXgtGdVt-887967055%2Fuploads%2Fgit-blob-6fd54e1b8bbb426e43ba6aa4f741d868a0c22971%2Fjenkins_plugin.png?alt=media)

관리자 비밀번호를 입력하고 나면, 플러그인 설치 관련해서 나오며, 일반적인 설치를 위해 `Install suggested plugins`를 선택했다.

![suggested\_plugins](https://1681454910-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M26jG1i8u0kjXgtGdVt-887967055%2Fuploads%2Fgit-blob-3d9b880fbc9b597e6a0039b65d25106db8b853b2%2Fsuggested_plugins.png?alt=media)

해당 플러그인이 모두 설치되고 나면, 어드민 계정 생성 화면이 나온다.

![create\_admin\_user](https://1681454910-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M26jG1i8u0kjXgtGdVt-887967055%2Fuploads%2Fgit-blob-07b0afd3f4a93d1c776208829a34a82022051ec1%2Fcreate_admin_user.png?alt=media)

별도 생성없이 skip하고 넘어가게되면, URL 설정하는 부분이 나오며, 각자 맞게 설정해주면된다.

![configure](https://1681454910-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M26jG1i8u0kjXgtGdVt-887967055%2Fuploads%2Fgit-blob-f748d9efc19957f788f993ce0755463c3543d82d%2Fconfigure.png?alt=media)

![complete](https://1681454910-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M26jG1i8u0kjXgtGdVt-887967055%2Fuploads%2Fgit-blob-a161b13beab439eb584c6123ceb217f51b2c5134%2Fcomplete.png?alt=media)

설정이 완료되고나서 `Start using Jenkins` 버튼을 클릭하면 welcome 페이지로 연결된다.

![welcome](https://1681454910-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M26jG1i8u0kjXgtGdVt-887967055%2Fuploads%2Fgit-blob-93ac4d1ed3f240775cbcf3fbd4700cf883506957%2Fwelcome.png?alt=media)

### 종료하기

```bash
$ brew services stop jenkins
Stopping `jenkins`... (might take a while)
==> Successfully stopped `jenkins` (label: homebrew.mxcl.jenkins)
```


---

# 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://dahye-jeong.gitbook.io/java/master-1/devops/2021-11-28-jenkins.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.
