diff --git a/Makefile b/Makefile index 4704332bac..9b40e3b977 100644 --- a/Makefile +++ b/Makefile @@ -51,11 +51,11 @@ GOIMPORTS_OPT?= -w -local $(CW_AGENT_IMPORT_PATH) GOIMPORTS = $(TOOLS_BIN_DIR)/goimports SHFMT = $(TOOLS_BIN_DIR)/shfmt LINTER = $(TOOLS_BIN_DIR)/golangci-lint -release: clean test build package-rpm package-deb package-win package-darwin +release: clean build package-rpm package-deb nightly-release: release -build: check_secrets cwagent-otel-collector amazon-cloudwatch-agent config-translator start-amazon-cloudwatch-agent amazon-cloudwatch-agent-config-wizard config-downloader +build: cwagent-otel-collector amazon-cloudwatch-agent config-translator start-amazon-cloudwatch-agent amazon-cloudwatch-agent-config-wizard config-downloader check_secrets:: if grep --exclude-dir=build --exclude-dir=vendor -E "(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}|(\"|')?(AWS|aws|Aws)?_?(SECRET|secret|Secret)?_?(ACCESS|access|Access)?_?(KEY|key|Key)(\"|')?\\s*(:|=>|=)\\s*(\"|')?[A-Za-z0-9/\\+=]{40}(\"|')?" -Rn .; then echo "check_secrets failed"; exit 1; fi; @@ -91,29 +91,21 @@ config-translator: copy-version-file @echo Building config-translator $(LINUX_AMD64_BUILD)/config-translator github.com/aws/amazon-cloudwatch-agent/cmd/config-translator $(LINUX_ARM64_BUILD)/config-translator github.com/aws/amazon-cloudwatch-agent/cmd/config-translator - $(WIN_BUILD)/config-translator.exe github.com/aws/amazon-cloudwatch-agent/cmd/config-translator - $(DARWIN_BUILD)/config-translator github.com/aws/amazon-cloudwatch-agent/cmd/config-translator start-amazon-cloudwatch-agent: copy-version-file @echo Building start-amazon-cloudwatch-agent $(LINUX_AMD64_BUILD)/start-amazon-cloudwatch-agent github.com/aws/amazon-cloudwatch-agent/cmd/start-amazon-cloudwatch-agent $(LINUX_ARM64_BUILD)/start-amazon-cloudwatch-agent github.com/aws/amazon-cloudwatch-agent/cmd/start-amazon-cloudwatch-agent - $(WIN_BUILD)/start-amazon-cloudwatch-agent.exe github.com/aws/amazon-cloudwatch-agent/cmd/start-amazon-cloudwatch-agent - $(DARWIN_BUILD)/start-amazon-cloudwatch-agent github.com/aws/amazon-cloudwatch-agent/cmd/start-amazon-cloudwatch-agent amazon-cloudwatch-agent-config-wizard: copy-version-file @echo Building amazon-cloudwatch-agent-config-wizard $(LINUX_AMD64_BUILD)/amazon-cloudwatch-agent-config-wizard github.com/aws/amazon-cloudwatch-agent/cmd/amazon-cloudwatch-agent-config-wizard $(LINUX_ARM64_BUILD)/amazon-cloudwatch-agent-config-wizard github.com/aws/amazon-cloudwatch-agent/cmd/amazon-cloudwatch-agent-config-wizard - $(WIN_BUILD)/amazon-cloudwatch-agent-config-wizard.exe github.com/aws/amazon-cloudwatch-agent/cmd/amazon-cloudwatch-agent-config-wizard - $(DARWIN_BUILD)/amazon-cloudwatch-agent-config-wizard github.com/aws/amazon-cloudwatch-agent/cmd/amazon-cloudwatch-agent-config-wizard config-downloader: copy-version-file @echo Building config-downloader $(LINUX_AMD64_BUILD)/config-downloader github.com/aws/amazon-cloudwatch-agent/cmd/config-downloader $(LINUX_ARM64_BUILD)/config-downloader github.com/aws/amazon-cloudwatch-agent/cmd/config-downloader - $(WIN_BUILD)/config-downloader.exe github.com/aws/amazon-cloudwatch-agent/cmd/config-downloader - $(DARWIN_BUILD)/config-downloader github.com/aws/amazon-cloudwatch-agent/cmd/config-downloader # A fast build that only builds amd64, we don't need wizard and config downloader build-for-docker: build-for-docker-amd64 diff --git a/cmd/config-downloader/downloader.go b/cmd/config-downloader/downloader.go index ca5102a42b..5597447aef 100644 --- a/cmd/config-downloader/downloader.go +++ b/cmd/config-downloader/downloader.go @@ -193,16 +193,19 @@ func main() { switch locationArray[0] { case locationDefault: outputFilePath = locationDefault + log.Printf("Abot",outputFilePath) if multiConfig != "remove" { config, err = defaultJsonConfig(mode) } case locationSSM: outputFilePath = locationSSM + "_" + EscapeFilePath(locationArray[1]) + log.Printf("Read",outputFilePath) if multiConfig != "remove" { config, err = downloadFromSSM(region, locationArray[1], mode, cc.CredentialsMap()) } case locationFile: outputFilePath = locationFile + "_" + EscapeFilePath(filepath.Base(locationArray[1])) + log.Printf("Test",outputFilePath) if multiConfig != "remove" { config, err = readFromFile(locationArray[1]) } diff --git a/packaging/dependencies/amazon-cloudwatch-agent-ctl b/packaging/dependencies/amazon-cloudwatch-agent-ctl index 5de4a7698e..e2c741bacd 100755 --- a/packaging/dependencies/amazon-cloudwatch-agent-ctl +++ b/packaging/dependencies/amazon-cloudwatch-agent-ctl @@ -335,9 +335,8 @@ cwa_config() { if [ "${cwa_config_location}" = "${ALL_CONFIG}" ]; then rm -rf "${JSON_DIR}"/* else - runDownloaderCommand="${CMDDIR}/config-downloader --output-dir ${JSON_DIR} --download-source ${cwa_config_location} --mode ${param_mode} --config ${COMMON_CONIG} --multi-config ${multi_config}" - echo "${runDownloaderCommand}" - ${runDownloaderCommand} || return + runDownloaderCommand=`"${CMDDIR}/config-downloader" --output-dir "${JSON_DIR}" --download-source "${cwa_config_location}" --mode ${param_mode} --config "${COMMON_CONIG}" --multi-config ${multi_config}` + echo "${runDownloaderCommand}" || return fi if [ ! "$(ls ${JSON_DIR})" ]; then @@ -345,9 +344,8 @@ cwa_config() { rm -f "${TOML}" else echo "Start configuration validation..." - runTranslatorCommand="${CMDDIR}/config-translator --input ${JSON} --input-dir ${JSON_DIR} --output ${TOML} --mode ${param_mode} --config ${COMMON_CONIG} --multi-config ${multi_config}" - echo "${runTranslatorCommand}" - ${runTranslatorCommand} || return + runTranslatorCommand=`"${CMDDIR}/config-translator" --input "${JSON}" --input-dir "${JSON_DIR}" --output "${TOML}" --mode ${param_mode} --config "${COMMON_CONIG}" --multi-config ${multi_config}` + echo "${runTranslatorCommand}" || return runAgentSchemaTestCommand="${CMDDIR}/amazon-cloudwatch-agent -schematest -config ${TOML}" echo "${runAgentSchemaTestCommand}"