https://github.com/zkfmapf123/cicd-pipeline
cicd-pipeline
https://github.com/zkfmapf123/cicd-pipeline
Last synced: 11 months ago
JSON representation
cicd-pipeline
- Host: GitHub
- URL: https://github.com/zkfmapf123/cicd-pipeline
- Owner: zkfmapf123
- Created: 2023-06-11T04:35:17.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-06-15T14:53:59.000Z (about 3 years ago)
- Last Synced: 2025-03-02T22:42:13.555Z (over 1 year ago)
- Language: TypeScript
- Size: 928 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CICD-pipeline


## Todo
- [x] GitHub -> Jenkins -> Push ECR -> EventBridge -> Lambda
- [x] EventBridge에서 Lambda에 함수전달


- [ ] Lambda는 오래된 이미지 삭제하고, ECS에 배포
- [ ] aws-cli를 활용해서 오래된 이미지 삭제
- [ ] 최근 이미지를 ecs에 배포
## Jenkins install
```
host에 Docker에 접근하는 방식 (DooD)을 사용하기 때문에,
host에 user, group을 먼저 설정해줘야 함
useradd ...
groupadd ...
```
- install docker (util_file/docker.sh)
- build docker images (util_file/Dockerfil.jenkins)
```
docker build -f Dockerfile.jenkins -t jenkins:1.0
```
- run jenkins container
```
docker run -d --name jenkins_container \
-v /var/run/docker.sock:/var/run/docker.sock \
-v jenkins_volume:/var/jenkins_home \
--restart=always \
-p 8080:8080 jenkins:1.0
chmod 777 /var/run/docker.sock
```
## Slack 추가하는 법
### 1. Slack에서 App 추가 (Admin이 해줘야 함)

### 2. Slack Channel 추가 (Admin이 해줘야 함)

### 3. Jenkins Plugin 추가 (Slack Notification)

### 4. Jenkins Management -> System Setting

### 5. Slack 추가 & Credential 설정


### 6. Test Connection

### 7. Check To Notification

## Reference
- t2.micro로 하니까 Docker가 못버텨주네... -> t3.small 정도는 해야함 (시간 애뺐김)
- Jenkins AmazonECR Registry 입력하는 법
- Jenkins Credentials withAWS 설정
- Jenkins Registry 설정 -> AWS Credentials (Global) Plugin 설정해야 함
- Slack Notification