Skip to content

Commit

Permalink
Fix elastic#3167 change ownership of files in build/
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 committed Dec 13, 2016
1 parent 1ac7bf8 commit 888bd82
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 -it alpine:3.4 sh -c "chown -R $(shell id -u):$(shell id -g) /build"

0 comments on commit 888bd82

Please sign in to comment.