Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/choshsh/slack-go
AWS Codebuild용 Slack 알림 cli tool
https://github.com/choshsh/slack-go
codebuild golang slack
Last synced: 13 days ago
JSON representation
AWS Codebuild용 Slack 알림 cli tool
- Host: GitHub
- URL: https://github.com/choshsh/slack-go
- Owner: choshsh
- Created: 2022-01-31T13:38:48.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-03-04T21:18:04.000Z (11 months ago)
- Last Synced: 2024-12-01T23:13:31.838Z (2 months ago)
- Topics: codebuild, golang, slack
- Language: Go
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# slack-go
AWS CodeBuild에서 Slack Incoming Webhook을 사용하여 알림을 보내기 위한 cli 도구입니다.
## 설치
### Dockerfile
Dockerfile에 바이너리 파일을 다운받아 설치합니다. (AWS CodeBuild에 사용하는 컨테이너 이미지)
```docker
...
RUN wget -q https://github.com/choshsh/slack-go/releases/latest/download/slack-go-linux-amd64 -O /usr/local/bin/slack-go && \
chmod +x /usr/local/bin/slack-go
```## 사용법
### 파라미터 설정
| Key | Data Type | Description | Example |
| --- | --- | --- | --- |
| msg | String | Slack 메시지 | -msg '빌드를 시작합니다’ |
| notifyStatus | Boolean | (Optional) 빌드 결과를 알림에 포함할지 여부. Default false | -notifyStatus true |### AWS 설정
- CodeBuild
환경변수를 추가합니다.
![https://user-images.githubusercontent.com/40452325/151839371-630a053a-b6fe-4cb5-9e54-cfc8e54ee442.png](https://user-images.githubusercontent.com/40452325/151839371-630a053a-b6fe-4cb5-9e54-cfc8e54ee442.png)
- buildspec.yml
aws codebuild 스크립트에 slack-go 명령어를 추가합니다.
```yaml
phases:
pre_build:
commands: slack-go -msg '빌드를 시작합니다'
...
post_build:
commands: slack-go -msg '빌드가 종료됐습니다' -notifyStatus true
```
### 실행 예시
![https://user-images.githubusercontent.com/40452325/151831388-2272393e-4875-4f55-8db7-0fe40e22a996.png](https://user-images.githubusercontent.com/40452325/151831388-2272393e-4875-4f55-8db7-0fe40e22a996.png)
![https://user-images.githubusercontent.com/40452325/151831488-3de8a0b5-a8cf-40d6-b6ae-99e3949d5036.png](https://user-images.githubusercontent.com/40452325/151831488-3de8a0b5-a8cf-40d6-b6ae-99e3949d5036.png)
![https://user-images.githubusercontent.com/40452325/151831562-9108ad10-0933-40aa-a770-2dc5a8efcbdb.png](https://user-images.githubusercontent.com/40452325/151831562-9108ad10-0933-40aa-a770-2dc5a8efcbdb.png)