Skip to content

Commit

Permalink
Fix elastic#3167 change ownership of files in build/ (elastic#3168)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cyrilleverrier authored and suraj-soni committed Dec 15, 2016
1 parent a0b96cf commit 6f9af19
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion libbeat/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -405,11 +409,15 @@ 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
mkdir -p ${BUILD_DIR}
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"

0 comments on commit 6f9af19

Please sign in to comment.