metron-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kylerichard...@apache.org
Subject incubator-metron git commit: METRON-644 RPM builds only work with Docker for Mac (kylerichardson) closes apache/incubator-metron#409
Date Fri, 13 Jan 2017 01:43:28 GMT
Repository: incubator-metron
Updated Branches:
  refs/heads/master 763f2fc42 -> 52aa58050


METRON-644 RPM builds only work with Docker for Mac (kylerichardson) closes apache/incubator-metron#409


Project: http://git-wip-us.apache.org/repos/asf/incubator-metron/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-metron/commit/52aa5805
Tree: http://git-wip-us.apache.org/repos/asf/incubator-metron/tree/52aa5805
Diff: http://git-wip-us.apache.org/repos/asf/incubator-metron/diff/52aa5805

Branch: refs/heads/master
Commit: 52aa580505ec8b2b0b43244345aa05e39c756650
Parents: 763f2fc
Author: kylerichardson <kylerichardson2@gmail.com>
Authored: Thu Jan 12 20:40:15 2017 -0500
Committer: Kyle Richardson <kylerichardson@apache.org>
Committed: Thu Jan 12 20:40:15 2017 -0500

----------------------------------------------------------------------
 metron-deployment/README.md                            |  1 -
 metron-deployment/packaging/docker/rpm-docker/build.sh | 13 +++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/52aa5805/metron-deployment/README.md
----------------------------------------------------------------------
diff --git a/metron-deployment/README.md b/metron-deployment/README.md
index eceeb80..2abf363 100644
--- a/metron-deployment/README.md
+++ b/metron-deployment/README.md
@@ -163,7 +163,6 @@ Components in the RPMs:
 
 ### Prerequisites
 - Docker.  The image detailed in: `metron-deployment/packaging/docker/rpm-docker/README.md`
will automatically be built (or rebuilt if necessary).
-- On Mac, Docker Toolbox's handling of ownership causes permissions issues in the Docker
container.  Please use Docker for Mac instead.
 - Artifacts for metron-platform have been produced.  E.g. `mvn clean package -DskipTests`
in `metron-platform`
 
 ### Building RPMs

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/52aa5805/metron-deployment/packaging/docker/rpm-docker/build.sh
----------------------------------------------------------------------
diff --git a/metron-deployment/packaging/docker/rpm-docker/build.sh b/metron-deployment/packaging/docker/rpm-docker/build.sh
index 404a0fe..23ed90d 100755
--- a/metron-deployment/packaging/docker/rpm-docker/build.sh
+++ b/metron-deployment/packaging/docker/rpm-docker/build.sh
@@ -27,6 +27,19 @@ echo "VERSION: ${VERSION}"
 PRERELEASE=$(echo ${FULL_VERSION} | tr -d '"'"'[:digit:]\.'"'"')
 echo "PRERELEASE: ${PRERELEASE}"
 
+# Account for non-existent file owner in container
+# Ignore UID=0, root exists in all containers
+OWNER_UID=`ls -n SPECS/metron.spec | awk -F' ' '{ print $3 }'`
+id $OWNER_UID >/dev/null 2>&1
+if [ $? -ne 0 ] && [ $OWNER_UID -ne 0 ]; then
+    useradd -u $OWNER_UID builder
+fi
+
 rm -rf SRPMS/ RPMS/ && \
 rpmbuild -v -ba --define "_topdir $(pwd)" --define "_version ${VERSION}" --define "_prerelease
${PRERELEASE}" SPECS/metron.spec && \
 rpmlint -i SPECS/metron.spec RPMS/*/metron* SRPMS/metron
+
+# Ensure original user permissions are maintained after build
+if [ $OWNER_UID -ne 0 ]; then
+  chown -R $OWNER_UID *
+fi


Mime
View raw message