Skip to content

Commit

Permalink
Add a warning for uncommitted changes in copy-vendor, and quiet git c…
Browse files Browse the repository at this point in the history
…ommit (elastic#13381)

* Add a warning for uncommitted changes, add quiet to git commit
  • Loading branch information
fearful-symmetry authored Aug 29, 2019
1 parent eb5a3d7 commit 4ef2e07
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
9 changes: 7 additions & 2 deletions generator/beat/{beat}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pre-setup: copy-vendor git-init

# Copy beats into vendor directory
.PHONY: copy-vendor
copy-vendor:
copy-vendor: vendor-check
mkdir -p vendor/github.com/elastic/beats
git archive --remote ${BEAT_GOPATH}/src/github.com/elastic/beats HEAD | tar -x --exclude=x-pack -C vendor/github.com/elastic/beats
mkdir -p vendor/github.com/magefile
Expand All @@ -37,4 +37,9 @@ git-init:
.PHONY: git-add
git-add:
git add -A
git commit -m "Add generated {beat} files"
git commit -q -m "Add generated {beat} files"


.PHONY: vendor-check
vendor-check:
@if output=$$(git -C ${BEAT_GOPATH}/src/github.com/elastic/beats status --porcelain) && [ ! -z "$${output}" ]; then printf "\033[31mWARNING: elastic/beats has uncommitted changes, these will not be in the vendor directory!\033[0m\n"; fi
8 changes: 6 additions & 2 deletions generator/metricbeat/{beat}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ setup: copy-vendor git-init

# Copy beats into vendor directory
.PHONY: copy-vendor
copy-vendor:
copy-vendor: vendor-check
mkdir -p vendor/github.com/elastic/beats
git archive --remote ${BEAT_GOPATH}/src/github.com/elastic/beats HEAD | tar -x --exclude=x-pack -C vendor/github.com/elastic/beats
ln -sf ${PWD}/vendor/github.com/elastic/beats/metricbeat/scripts/generate_imports_helper.py ${PWD}/vendor/github.com/elastic/beats/script/generate_imports_helper.py
Expand All @@ -36,4 +36,8 @@ git-init:
.PHONY: git-add
git-add:
git add -A
git commit -m "Add generated {beat} files"
git commit -q -m "Add generated {beat} files"

.PHONY: vendor-check
vendor-check:
@if output=$$(git -C ${BEAT_GOPATH}/src/github.com/elastic/beats status --porcelain) && [ ! -z "$${output}" ]; then printf "\033[31mWARNING: elastic/beats has uncommitted changes, these will not be in the vendor directory!\033[0m\n"; fi

0 comments on commit 4ef2e07

Please sign in to comment.