forked from open-telemetry/opentelemetry-collector-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chore] Simplify tool management (open-telemetry#17849)
* Simplifying the tooling practice * Ensuring that commands that use a global install are moved to use the generated bin folder * Using `-p` to gracefully fail * Moving over to named imports * Fixing impi
- Loading branch information
1 parent
5266ecb
commit 15f51ec
Showing
3 changed files
with
67 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ local/ | |
*.dylib | ||
bin/ | ||
dist/ | ||
.tools/ | ||
|
||
# Emacs | ||
*~ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,12 +105,12 @@ golint: | |
$(MAKE) $(FOR_GROUP_TARGET) TARGET="lint" | ||
|
||
.PHONY: goimpi | ||
goimpi: install-tools | ||
goimpi: $(IMPI) | ||
@$(MAKE) $(FOR_GROUP_TARGET) TARGET="impi" | ||
|
||
.PHONY: goporto | ||
goporto: install-tools | ||
porto -w --include-internal --skip-dirs "^cmd$$" ./ | ||
goporto: $(PORTO) | ||
$(PORTO) -w --include-internal --skip-dirs "^cmd$$" ./ | ||
|
||
.PHONY: for-all | ||
for-all: | ||
|
@@ -126,9 +126,9 @@ COMMIT?=HEAD | |
MODSET?=contrib-core | ||
REMOTE?[email protected]:open-telemetry/opentelemetry-collector-contrib.git | ||
.PHONY: push-tags | ||
push-tags: | ||
multimod verify | ||
set -e; for tag in `multimod tag -m ${MODSET} -c ${COMMIT} --print-tags | grep -v "Using" `; do \ | ||
push-tags: $(MULITMOD) | ||
$(MULITMOD) verify | ||
set -e; for tag in `$(MULITMOD) tag -m ${MODSET} -c ${COMMIT} --print-tags | grep -v "Using" `; do \ | ||
echo "pushing tag $${tag}"; \ | ||
git push ${REMOTE} $${tag}; \ | ||
done; | ||
|
@@ -203,22 +203,6 @@ for-other-target: $(OTHER_MODS) | |
all-pwd: | ||
$(MAKE) $(FOR_GROUP_TARGET) TARGET="pwd" | ||
|
||
TOOLS_MOD_DIR := ./internal/tools | ||
.PHONY: install-tools | ||
install-tools: | ||
cd $(TOOLS_MOD_DIR) && $(GOCMD) install github.com/client9/misspell/cmd/misspell | ||
cd $(TOOLS_MOD_DIR) && $(GOCMD) install github.com/golangci/golangci-lint/cmd/golangci-lint | ||
cd $(TOOLS_MOD_DIR) && $(GOCMD) install github.com/google/addlicense | ||
cd $(TOOLS_MOD_DIR) && $(GOCMD) install github.com/jstemmer/go-junit-report | ||
cd $(TOOLS_MOD_DIR) && $(GOCMD) install github.com/pavius/impi/cmd/impi | ||
cd $(TOOLS_MOD_DIR) && $(GOCMD) install github.com/tcnksm/ghr | ||
cd $(TOOLS_MOD_DIR) && $(GOCMD) install go.opentelemetry.io/build-tools/checkdoc | ||
cd $(TOOLS_MOD_DIR) && $(GOCMD) install go.opentelemetry.io/build-tools/issuegenerator | ||
cd $(TOOLS_MOD_DIR) && $(GOCMD) install golang.org/x/tools/cmd/goimports | ||
cd $(TOOLS_MOD_DIR) && $(GOCMD) install go.opentelemetry.io/build-tools/multimod | ||
cd $(TOOLS_MOD_DIR) && $(GOCMD) install github.com/jcchavezs/porto/cmd/porto | ||
cd $(TOOLS_MOD_DIR) && $(GOCMD) install go.opentelemetry.io/build-tools/crosslink | ||
|
||
.PHONY: run | ||
run: | ||
cd ./cmd/otelcontribcol && GO111MODULE=on $(GOCMD) run --race . --config ../../${RUN_CONFIG} ${RUN_ARGS} | ||
|
@@ -250,26 +234,22 @@ mdatagen-test: | |
cd cmd/mdatagen && $(GOCMD) install . | ||
cd cmd/mdatagen && $(GOCMD) generate ./... | ||
|
||
.PHONY: chlog-install | ||
chlog-install: | ||
cd $(TOOLS_MOD_DIR) && $(GOCMD) install go.opentelemetry.io/build-tools/chloggen | ||
|
||
FILENAME?=$(shell git branch --show-current) | ||
.PHONY: chlog-new | ||
chlog-new: chlog-install | ||
chloggen new --filename $(FILENAME) | ||
chlog-new: $(CHLOGGEN) | ||
$(CHLOGGEN) new --filename $(FILENAME) | ||
|
||
.PHONY: chlog-validate | ||
chlog-validate: chlog-install | ||
chloggen validate | ||
chlog-validate: $(CHLOGGEN) | ||
$(CHLOGGEN) validate | ||
|
||
.PHONY: chlog-preview | ||
chlog-preview: chlog-install | ||
chloggen update --dry | ||
chlog-preview: $(CHLOGGEN) | ||
$(CHLOGGEN) update --dry | ||
|
||
.PHONY: chlog-update | ||
chlog-update: chlog-install | ||
chloggen update --version $(VERSION) | ||
chlog-update: $(CHLOGGEN) | ||
$(CHLOGGEN) update --version $(VERSION) | ||
|
||
# Build the Collector executable. | ||
.PHONY: otelcontribcol | ||
|
@@ -323,8 +303,8 @@ build-examples: | |
|
||
# Verify existence of READMEs for components specified as default components in the collector. | ||
.PHONY: checkdoc | ||
checkdoc: | ||
checkdoc --project-path $(CURDIR) --component-rel-path $(COMP_REL_PATH) --module-name $(MOD_NAME) | ||
checkdoc: $(CHECKDOC) | ||
$(CHECKDOC) --project-path $(CURDIR) --component-rel-path $(COMP_REL_PATH) --module-name $(MOD_NAME) | ||
|
||
.PHONY: all-checklinks | ||
all-checklinks: | ||
|
@@ -351,24 +331,24 @@ certs: | |
$(foreach dir, $(CERT_DIRS), $(call exec-command, @internal/buildscripts/gen-certs.sh -o $(dir))) | ||
|
||
.PHONY: multimod-verify | ||
multimod-verify: install-tools | ||
multimod-verify: $(MULITMOD) | ||
@echo "Validating versions.yaml" | ||
multimod verify | ||
$(MULITMOD) verify | ||
|
||
.PHONY: multimod-prerelease | ||
multimod-prerelease: install-tools | ||
multimod prerelease -s=true -b=false -v ./versions.yaml -m contrib-base | ||
multimod-prerelease: $(MULITMOD) | ||
$(MULITMOD) prerelease -s=true -b=false -v ./versions.yaml -m contrib-base | ||
$(MAKE) gotidy | ||
|
||
.PHONY: multimod-sync | ||
multimod-sync: install-tools | ||
multimod sync -a=true -s=true -o ../opentelemetry-collector | ||
multimod-sync: $(MULITMOD) | ||
$(MULITMOD) sync -a=true -s=true -o ../opentelemetry-collector | ||
$(MAKE) gotidy | ||
|
||
.PHONY: crosslink | ||
crosslink: install-tools | ||
crosslink: $(CROSSLINK) | ||
@echo "Executing crosslink" | ||
crosslink --root=$(shell pwd) | ||
$(CROSSLINK) --root=$(shell pwd) | ||
|
||
.PHONY: clean | ||
clean: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters