You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aurora.apache.org by js...@apache.org on 2016/03/14 20:05:50 UTC

[2/3] aurora-packaging git commit: Fixup rpm builder and test docs.

Fixup rpm builder and test docs.

This adjusts to fallout from https://reviews.apache.org/r/43936/ to get
the centos-7 builder working again and improves the test docs to include
both locally built rpm and released (or release candidate) rpm testing.

This change also imporves the `release-candidate` script to be
idempotent and handle missing binaries (ie: when only using a subset of
builders).

Reviewed at https://reviews.apache.org/r/44799/


Project: http://git-wip-us.apache.org/repos/asf/aurora-packaging/repo
Commit: http://git-wip-us.apache.org/repos/asf/aurora-packaging/commit/722a5379
Tree: http://git-wip-us.apache.org/repos/asf/aurora-packaging/tree/722a5379
Diff: http://git-wip-us.apache.org/repos/asf/aurora-packaging/diff/722a5379

Branch: refs/heads/0.12.x
Commit: 722a53797020d0895dc920dc60fe7b91829af16c
Parents: e9b879a
Author: John Sirois <js...@apache.org>
Authored: Mon Mar 14 13:05:36 2016 -0600
Committer: John Sirois <jo...@gmail.com>
Committed: Mon Mar 14 13:05:36 2016 -0600

----------------------------------------------------------------------
 build-support/release/release-candidate | 33 ++++++++++++++++++----------
 specs/rpm/Makefile                      |  5 ++---
 specs/rpm/aurora.spec                   |  2 +-
 test/rpm/centos-7/README.md             | 24 +++++++++++++++++---
 4 files changed, 45 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/722a5379/build-support/release/release-candidate
----------------------------------------------------------------------
diff --git a/build-support/release/release-candidate b/build-support/release/release-candidate
index c21a010..c08c885 100755
--- a/build-support/release/release-candidate
+++ b/build-support/release/release-candidate
@@ -28,25 +28,27 @@ function dist_dir() {
 
 function sign_artifacts() {
   local os="$1"
-  local dist_dir="$(dist_dir ${os})"
+  local dist_dir="$2"
+  local stage_dir="$3"
 
   find "${dist_dir}" -maxdepth 1 -type f | while read file; do
+    local name=$(basename "${file}")
     # Sign the tarball.
-    gpg --armor --output ${file}.asc --detach-sig ${file}
+    gpg --armor --output "${stage_dir}/${name}.asc" --detach-sig "${file}"
 
     # Create the checksums
-    gpg --print-md MD5 ${file} > ${file}.md5
-    shasum ${file} > ${file}.sha
+    gpg --print-md MD5 "${file}" > "${stage_dir}/${name}.md5"
+    shasum "${file}" > "${stage_dir}/${name}.sha"
   done
 }
 
 function zip_artifacts() {
   local os="$1"
-  local dist_dir="$(dist_dir ${os})"
+  local dist_dir="$2"
+  local stage_dir="$3"
 
-  local stage_dir="${dist_dir}/.stage"
-  rm -rf "${stage_dir}" && mkdir -p "${stage_dir}/${os}"
-  find "${dist_dir}" -maxdepth 1 -type f | while read file; do
+  rm -rf "${stage_dir}/${os}" && mkdir -p "${stage_dir}/${os}"
+  find "${dist_dir}" "${stage_dir}" -maxdepth 1 -type f | while read file; do
     ln -s ${file} "${stage_dir}/${os}/$(basename ${file})"
   done
 
@@ -56,9 +58,16 @@ function zip_artifacts() {
 }
 
 for os in $(oses); do
-  echo "Signing artifacts for ${os}..."
-  sign_artifacts "${os}"
-  archive="$(zip_artifacts "${os}")"
-  echo "Created archive for ${os} artifacts at ${archive}."
+  dist_dir="$(dist_dir ${os})"
+  if [[ -d "${dist_dir}" ]]; then
+    stage_dir="${dist_dir}/.stage"
+    rm -rf "${stage_dir}" && mkdir -p "${stage_dir}"
+    echo "Signing artifacts for ${os}..."
+    sign_artifacts "${os}" "${dist_dir}" "${stage_dir}"
+    archive="$(zip_artifacts "${os}" "${dist_dir}" "${stage_dir}")"
+    echo "Created archive for ${os} artifacts at ${archive}."
+  else
+    echo "Skipping artifacts for ${os} (not found built under ${dist_dir})."
+  fi
 done
 echo "All artifacts prepared for upload to bintray."

http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/722a5379/specs/rpm/Makefile
----------------------------------------------------------------------
diff --git a/specs/rpm/Makefile b/specs/rpm/Makefile
index 0fa2158..0476bcb 100644
--- a/specs/rpm/Makefile
+++ b/specs/rpm/Makefile
@@ -18,11 +18,10 @@ RPM_TOPDIR ?= $(DIST_DIR)
 
 DATETIME ?= $(shell date +%Y%m%d%H%M)
 
-SOURCE_TARGET ?= $(RPM_TOPDIR)/rpmbuild/SOURCES/aurora.tar.gz
-
 AURORA_VERSION ?= $(shell cat $(TOPDIR)/.auroraversion | tr '-' '.')
-MESOS_VERSION ?= $(shell sed -n 's/.*mesos\.native==\(.*\)/\1/p' $(TOPDIR)/3rdparty/python/requirements.txt)
+MESOS_VERSION ?= $(shell tr -d "'\" \t" < $(TOPDIR)/3rdparty/python/BUILD | sed -n 's/MESOS_REV=\(.*\)/\1/p' )
 
+SOURCE_TARGET ?= $(RPM_TOPDIR)/rpmbuild/SOURCES/$(AURORA_VERSION).tar.gz
 
 PHONY: all nightly_version release_version get_source_target clean mkdir srpm nightly_srpm nightly_rpm release_srpm release_rpm tar_source
 

http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/722a5379/specs/rpm/aurora.spec
----------------------------------------------------------------------
diff --git a/specs/rpm/aurora.spec b/specs/rpm/aurora.spec
index 20a6d34..61e7d14 100644
--- a/specs/rpm/aurora.spec
+++ b/specs/rpm/aurora.spec
@@ -141,7 +141,7 @@ state of all running tasks.
 
 
 %prep
-%setup -n aurora-rel-%{version}
+%setup -n apache-aurora-%{version}
 
 
 %build

http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/722a5379/test/rpm/centos-7/README.md
----------------------------------------------------------------------
diff --git a/test/rpm/centos-7/README.md b/test/rpm/centos-7/README.md
index 6a6e419..527fbb2 100644
--- a/test/rpm/centos-7/README.md
+++ b/test/rpm/centos-7/README.md
@@ -2,21 +2,39 @@
 
 ## Install packages
 
-### Install vagrant scp
+Two methods are described, one for installing locally built packages, the other
+for installing released packages or release candidate packages.
+
+### Locally built
+
+#### Install vagrant scp
 
     vagrant plugin install vagrant-scp
 
-### Then scp over the newly built packages
+#### Then scp over the newly built packages
 
     for rpm in ../../../artifacts/aurora-centos-7/dist/rpmbuild/RPMS/x86_64/*.rpm; do
       vagrant scp $rpm aurora_centos_7:$(basename $rpm)
     done
 
-### Install each rpm
+#### Install each rpm
 
     vagrant ssh -- -L8081:localhost:8081 -L1338:localhost:1338
     sudo yum install -y *.rpm
 
+### Released
+
+    vagrant ssh -- -L8081:localhost:8081 -L1338:localhost:1338
+    version=0.12.0
+    pkg_root="https://apache.bintray.com/aurora/centos-7/"
+    for rpm in \
+        aurora-scheduler-${version}-1.el7.centos.aurora.x86_64.rpm \
+        aurora-executor-${version}-1.el7.centos.aurora.x86_64.rpm \
+        aurora-tools-${version}-1.el7.centos.aurora.x86_64.rpm; do
+      wget $pkg_root/$rpm
+      sudo yum install -y $rpm
+    done
+
 ## Initialize and start
 
     sudo -u aurora mkdir -p /var/lib/aurora/scheduler/db