From a62c4acf939e6c8a3914b9e3061ef8113f2894ca Mon Sep 17 00:00:00 2001 From: Cyrille Verrier Date: Tue, 13 Dec 2016 21:00:44 +0100 Subject: [PATCH] Fix #3167 change ownership of files in build/ (#3168) Add a new Makefile rule: fix-permissions fix-permissions runs a docker container that changes the ownership of all files from root to the user that runs the Makefile --- libbeat/scripts/Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libbeat/scripts/Makefile b/libbeat/scripts/Makefile index b46c21c8674..d8717551e5f 100755 --- a/libbeat/scripts/Makefile +++ b/libbeat/scripts/Makefile @@ -220,6 +220,10 @@ testsuite: clean collect $(MAKE) benchmark-tests $(MAKE) coverage-report + if [ $(TEST_ENVIRONMENT) = true ]; then \ + $(MAKE) fix-permissions; \ + fi + # Generates a coverage report from the existing coverage files .PHONY: coverage-report coverage-report: @@ -405,7 +409,7 @@ package: package-setup fi SNAPSHOT=${SNAPSHOT} BUILDID=${BUILDID} BEAT_DIR=${BEAT_DIR} BUILD_DIR=${BUILD_DIR} $(MAKE) -C ${ES_BEATS}/dev-tools/packer ${PACKAGES} ${BUILD_DIR}/upload/build_id.txt - + $(MAKE) fix-permissions echo "Finished packages for ${BEATNAME}" package-dashboards: package-setup @@ -413,3 +417,7 @@ package-dashboards: package-setup cp -r _meta/kibana ${BUILD_DIR}/dashboards # build the dashboards package BEATNAME=${BEATNAME} BUILD_DIR=${BUILD_DIR} SNAPSHOT=$(SNAPSHOT) $(MAKE) -C ${ES_BEATS}/dev-tools/packer package-dashboards ${shell pwd}/build/upload/build_id.txt + +fix-permissions: + # Change ownership of all files inside /build folder from root/root to current user/group + docker run -v ${BUILD_DIR}:/build alpine:3.4 sh -c "chown -R $(shell id -u):$(shell id -g) /build" \ No newline at end of file