Skip to content

Commit

Permalink
store secret in env
Browse files Browse the repository at this point in the history
  • Loading branch information
83bytes committed Jul 1, 2024
1 parent a9d523a commit dfa13d8
Show file tree
Hide file tree
Showing 6 changed files with 841 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
alertmanager
alert-manager-config-2.yml
.env
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
ifneq (,$(wildcard ./.env))
include .env
export
endif

ALERTMANAGER_VERSION := $(shell ./alertmanager --version | cut -d" " -f3)

sed:
sed -i 's/WEBHOOK_SECRET/${WEBHOOK_SECRET}/' alert-manager-config.yml
sed -i 's/WEBHOOK_SECRET/${WEBHOOK_SECRET}/' deployment/toy_alert_manager.yml
# sed 's/WEBHOOK_SECRET/${WEBHOOK_SECRET}/' alert-manager-config.yml

clean:
rm alertmanager

build: vet
go build -tags netgo

docker-build: build
docker build -t alertmanager:$(ALERTMANAGER_VERSION) -f Dockerfile .
docker build -t alertmanager:$(ALERTMANAGER_VERSION) -f Dockerfile .

docker-push: docker-build
docker tag alertmanager:$(ALERTMANAGER_VERSION) sohom83/tam:$(ALERTMANAGER_VERSION)
docker push sohom83/tam:$(ALERTMANAGER_VERSION)

test:
go test ./... -v
Expand Down
2 changes: 1 addition & 1 deletion alert-manager-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ alert_pipelines:
action_args: ARG1,ARG2
- step_name: ACTION_STEP_1
action_name: SendToSlack
action_args: "https://hooks.slack.com/services/SECRET"
action_args: "https://hooks.slack.com/services/WEBHOOK_SECRET"

- alert_name: KubePodCrashLooping
enrichments:
Expand Down
Loading

0 comments on commit dfa13d8

Please sign in to comment.