Skip to content

Commit

Permalink
Add ligai dk version notify
Browse files Browse the repository at this point in the history
  • Loading branch information
谭彪 committed Nov 2, 2024
1 parent ba27104 commit f88ffae
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ release-stable:
- make pub_conf_samples
- make production_image GIT_BRANCH=$CI_COMMIT_BRANCH VERSION="$CI_VERSION"
- make uos_image_production GIT_BRANCH=$CI_COMMIT_BRANCH VERSION="$CI_VERSION" PKGEBPF=true
- make push_ligai_version VERSION="$CI_VERSION" LIGAI_CUSTOMFIELD=$LIGAI_CUSTOMFIELD LIGAI_AUTO_DEVOPS_TOKEN=$LIGAI_AUTO_DEVOPS_TOKEN LIGAI_API=$LIGAI_API
tags:
- cloudcare-ft

Expand Down
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ LOCAL_OSS_ADDR ?= "not-set" # you should export these env in your make
LOCAL_UPLOAD_ADDR ?= ${LOCAL_OSS_ADDR}
LOCAL_DOWNLOAD_CDN ?= ${LOCAL_OSS_ADDR} # CDN set as the same OSS bucket

# ligai version notify settings
LIGAI_CUSTOMFIELD ?=not_set
LIGAI_AUTO_DEVOPS_TOKEN ?=not_set
LIGAI_API ?=not_set

# Local envs to publish local testing binaries.
# export LOCAL_OSS_ACCESS_KEY = '<your-oss-AK>'
# export LOCAL_OSS_SECRET_KEY = '<your-oss-SK>'
Expand Down Expand Up @@ -498,3 +503,16 @@ endef

detect_mr_target_branch:
$(call check_mr_target_branch,$(MERGE_REQUEST_TARGET_BRANCH))

push_ligai_version:
@printf "$(HL)push new datakit version $(VERSION) to ligai...\n$(NC)";
@curl -i -X POST \
-H 'Content-Type: application/json' \
-H "auto_devops_token: $(LIGAI_AUTO_DEVOPS_TOKEN)" \
-d '{"version":"$(VERSION)","field_code":"$(LIGAI_CUSTOMFIELD)"}' \
$(LIGAI_API)
@if [ $$? != 0 ]; then \
printf "$(RED) [WARN] push version to ligai failed"; \
else \
printf "[INFO] push version to ligai ok"; \
fi

0 comments on commit f88ffae

Please sign in to comment.