Permalink
Browse files

Add package_builder branch configuration.

Drops deb_packager_url and rpm_packager_url in favor of
just packager_url.

Adds a new packager_branch configuration option which is
now exposed in the UI.

Consolidates the builder shell code in a common 'build_packages'
shell function.
  • Loading branch information...
1 parent 2d949ee commit c8c1bd8cfaa2b84673c95f62c1f10c89c72163f9 @dprince committed Jan 1, 2013
View
@@ -82,28 +82,28 @@ def self.run_job(job, template_name="puppet_vpc_runner.sh.erb", script_text=nil)
end
nova_builder=job.job_group.smoke_test.nova_package_builder
- nova_deb_packager_url=nova_builder.deb_packager_url
- nova_rpm_packager_url=nova_builder.rpm_packager_url
+ nova_packager_url=nova_builder.packager_url
+ nova_packager_branch=nova_builder.packager_branch
glance_builder=job.job_group.smoke_test.glance_package_builder
- glance_deb_packager_url=glance_builder.deb_packager_url
- glance_rpm_packager_url=glance_builder.rpm_packager_url
+ glance_packager_url=glance_builder.packager_url
+ glance_packager_branch=glance_builder.packager_branch
keystone_builder=job.job_group.smoke_test.keystone_package_builder
- keystone_deb_packager_url=keystone_builder.deb_packager_url
- keystone_rpm_packager_url=keystone_builder.rpm_packager_url
+ keystone_packager_url=keystone_builder.packager_url
+ keystone_packager_branch=keystone_builder.packager_branch
swift_builder=job.job_group.smoke_test.swift_package_builder
- swift_deb_packager_url=swift_builder.deb_packager_url
- swift_rpm_packager_url=swift_builder.rpm_packager_url
+ swift_packager_url=swift_builder.packager_url
+ swift_packager_branch=swift_builder.packager_branch
cinder_builder=job.job_group.smoke_test.cinder_package_builder
- cinder_deb_packager_url=cinder_builder.deb_packager_url
- cinder_rpm_packager_url=cinder_builder.rpm_packager_url
+ cinder_packager_url=cinder_builder.packager_url
+ cinder_packager_branch=cinder_builder.packager_branch
quantum_builder=job.job_group.smoke_test.quantum_package_builder
- quantum_deb_packager_url=quantum_builder.deb_packager_url
- quantum_rpm_packager_url=quantum_builder.rpm_packager_url
+ quantum_packager_url=quantum_builder.packager_url
+ quantum_packager_branch=quantum_builder.packager_branch
cookbook_url = ""
if job.job_group.smoke_test.cookbook_url and not job.job_group.smoke_test.cookbook_url.blank? then
@@ -124,38 +124,38 @@ def self.run_job(job, template_name="puppet_vpc_runner.sh.erb", script_text=nil)
nova_builder.branch || "",
nova_builder.merge_trunk.to_s,
nova_builder.revision_hash,
- nova_deb_packager_url,
- nova_rpm_packager_url,
+ nova_packager_url,
+ nova_packager_branch,
keystone_builder.url,
keystone_builder.branch || "",
keystone_builder.merge_trunk.to_s,
keystone_builder.revision_hash,
- keystone_deb_packager_url,
- keystone_rpm_packager_url,
+ keystone_packager_url,
+ keystone_packager_branch,
glance_builder.url,
glance_builder.branch || "",
glance_builder.merge_trunk.to_s,
glance_builder.revision_hash,
- glance_deb_packager_url,
- glance_rpm_packager_url,
+ glance_packager_url,
+ glance_packager_branch,
swift_builder.url,
swift_builder.branch || "",
swift_builder.merge_trunk.to_s,
swift_builder.revision_hash,
- swift_deb_packager_url,
- swift_rpm_packager_url,
+ swift_packager_url,
+ swift_packager_branch,
cinder_builder.url,
cinder_builder.branch || "",
cinder_builder.merge_trunk.to_s,
cinder_builder.revision_hash,
- cinder_deb_packager_url,
- cinder_rpm_packager_url,
+ cinder_packager_url,
+ cinder_packager_branch,
quantum_builder.url,
quantum_builder.branch || "",
quantum_builder.merge_trunk.to_s,
quantum_builder.revision_hash,
- quantum_deb_packager_url,
- quantum_rpm_packager_url,
+ quantum_packager_url,
+ quantum_packager_branch,
config_template_description,
cookbook_url,
node_configs_dir,
@@ -1,50 +1,48 @@
#!/bin/bash
-
-
CUSTOM_ENV_FILE=${1}
source $CUSTOM_ENV_FILE
NOVA_URL=${2}
NOVA_BRANCH=${3}
NOVA_MERGE_TRUNK=${4}
NOVA_REVISION=${5}
-NOVA_DEB_PACKAGER_URL=${6:-$NOVA_DEB_PACKAGER_URL}
-NOVA_RPM_PACKAGER_URL=${7:-$NOVA_RPM_PACKAGER_URL}
+NOVA_PACKAGER_URL=${6:-$NOVA_PACKAGER_URL}
+NOVA_PACKAGER_BRANCH=${7:-$NOVA_PACKAGER_BRANCH}
KEYSTONE_URL=${8}
KEYSTONE_BRANCH=${9}
KEYSTONE_MERGE_TRUNK=${10}
KEYSTONE_REVISION=${11}
-KEYSTONE_DEB_PACKAGER_URL=${12:-$KEYSTONE_DEB_PACKAGER_URL}
-KEYSTONE_RPM_PACKAGER_URL=${13:-$KEYSTONE_RPM_PACKAGER_URL}
+KEYSTONE_PACKAGER_URL=${12:-$KEYSTONE_PACKAGER_URL}
+KEYSTONE_PACKAGER_BRANCH=${13:-$KEYSTONE_PACKAGER_BRANCH}
GLANCE_URL=${14}
GLANCE_BRANCH=${15}
GLANCE_MERGE_TRUNK=${16}
GLANCE_REVISION=${17}
-GLANCE_DEB_PACKAGER_URL=${18:-$GLANCE_DEB_PACKAGER_URL}
-GLANCE_RPM_PACKAGER_URL=${19:-$GLANCE_RPM_PACKAGER_URL}
+GLANCE_PACKAGER_URL=${18:-$GLANCE_PACKAGER_URL}
+GLANCE_PACKAGER_BRANCH=${19:-$GLANCE_PACKAGER_BRANCH}
SWIFT_URL=${20}
SWIFT_BRANCH=${21}
SWIFT_MERGE_TRUNK=${22}
SWIFT_REVISION=${23}
-SWIFT_DEB_PACKAGER_URL=${24:-$SWIFT_DEB_PACKAGER_URL}
-SWIFT_RPM_PACKAGER_URL=${25:-$SWIFT_RPM_PACKAGER_URL}
+SWIFT_PACKAGER_URL=${24:-$SWIFT_PACKAGER_URL}
+SWIFT_PACKAGER_BRANCH=${25:-$SWIFT_PACKAGER_BRANCH}
CINDER_URL=${26}
CINDER_BRANCH=${27}
CINDER_MERGE_TRUNK=${28}
CINDER_REVISION=${29}
-CINDER_DEB_PACKAGER_URL=${30:-$CINDER_DEB_PACKAGER_URL}
-CINDER_RPM_PACKAGER_URL=${31:-$CINDER_RPM_PACKAGER_URL}
+CINDER_PACKAGER_URL=${30:-$CINDER_PACKAGER_URL}
+CINDER_PACKAGER_BRANCH=${31:-$CINDER_PACKAGER_BRANCH}
QUANTUM_URL=${32}
QUANTUM_BRANCH=${33}
QUANTUM_MERGE_TRUNK=${34}
QUANTUM_REVISION=${35}
-QUANTUM_DEB_PACKAGER_URL=${36:-$QUANTUM_DEB_PACKAGER_URL}
-QUANTUM_RPM_PACKAGER_URL=${37:-$QUANTUM_RPM_PACKAGER_URL}
+QUANTUM_PACKAGER_URL=${36:-$QUANTUM_PACKAGER_URL}
+QUANTUM_PACKAGER_BRANCH=${37:-$QUANTUM_PACKAGER_BRANCH}
CONFIG_TEMPLATE_DESCRIPTION=${38}
COOKBOOK_URL=${39}
@@ -60,14 +58,14 @@ SWIFT_GIT_MASTER_BRANCH=${SWIFT_GIT_MASTER_BRANCH:-"master"}
CINDER_GIT_MASTER_BRANCH=${CINDER_GIT_MASTER_BRANCH:-"master"}
QUANTUM_GIT_MASTER_BRANCH=${QUANTUM_GIT_MASTER_BRANCH:-"master"}
-# Setup default RPM packager branches
+# Setup default packager branches
# These may be overridden by some environements
-NOVA_RPM_PACKAGER_BRANCH=${NOVA_RPM_PACKAGER_BRANCH:-"master"}
-GLANCE_RPM_PACKAGER_BRANCH=${GLANCE_RPM_PACKAGER_BRANCH:-"master"}
-KEYSTONE_RPM_PACKAGER_BRANCH=${KEYSTONE_RPM_PACKAGER_BRANCH:-"master"}
-SWIFT_RPM_PACKAGER_BRANCH=${SWIFT_RPM_PACKAGER_BRANCH:-"master"}
-CINDER_RPM_PACKAGER_BRANCH=${CINDER_RPM_PACKAGER_BRANCH:-"master"}
-QUANTUM_RPM_PACKAGER_BRANCH=${QUANTUM_RPM_PACKAGER_BRANCH:-"master"}
+NOVA_PACKAGER_BRANCH=${NOVA_PACKAGER_BRANCH:-"master"}
+GLANCE_PACKAGER_BRANCH=${GLANCE_PACKAGER_BRANCH:-"master"}
+KEYSTONE_PACKAGER_BRANCH=${KEYSTONE_PACKAGER_BRANCH:-"master"}
+SWIFT_PACKAGER_BRANCH=${SWIFT_PACKAGER_BRANCH:-"master"}
+CINDER_PACKAGER_BRANCH=${CINDER_PACKAGER_BRANCH:-"master"}
+QUANTUM_PACKAGER_BRANCH=${QUANTUM_PACKAGER_BRANCH:-"master"}
GIT_CACHE_DIR=${GIT_CACHE_DIR:-"$HOME/.smokestack_git_cache"}
@@ -298,6 +296,192 @@ function stop_metric {
METRIC_SOURCE=""
}
+function build_packages {
+
+ local NOVA_MERGE_MASTER=""
+ if [[ "$NOVA_MERGE_TRUNK" == "true" ]]; then
+ NOVA_MERGE_MASTER="true"
+ fi
+ start_metric "Build Nova"
+ rake nova:build_packages SOURCE_DIR="$TMP_DIR/nova_source" \
+ SERVER_NAME="$BUILD_SERVER_NAME" \
+ RPM_PACKAGER_URL="$NOVA_PACKAGER_URL" \
+ RPM_PACKAGER_BRANCH="$NOVA_PACKAGER_BRANCH" \
+ SOURCE_URL="$NOVA_URL" \
+ SOURCE_BRANCH="$NOVA_BRANCH" \
+ GIT_MASTER="$NOVA_GIT_MASTER" \
+ GIT_MERGE_MASTER_BRANCH="$NOVA_GIT_MASTER_BRANCH" \
+ MERGE_MASTER="$NOVA_MERGE_MASTER" \
+ REVISION="$NOVA_REVISION" \
+ CACHEURL="$RPM_CACHEURL" \
+ || fail "Failed to build nova packages."
+ stop_metric
+
+ start_metric "Build Python-Novaclient"
+ rake nova:build_python_novaclient \
+ SERVER_NAME="$BUILD_SERVER_NAME" \
+ SOURCE_URL="$NOVACLIENT_GIT_MASTER" \
+ RPM_PACKAGER_URL="$NOVACLIENT_PACKAGER_URL" \
+ CACHEURL="$RPM_CACHEURL" \
+ || fail "Failed to build novaclient packages."
+ stop_metric
+
+ local GLANCE_MERGE_MASTER=""
+ if [[ "$GLANCE_MERGE_TRUNK" == "true" ]]; then
+ GLANCE_MERGE_MASTER="true"
+ fi
+
+ start_metric "Build Glance"
+ rake glance:build_packages SOURCE_DIR="$TMP_DIR/glance_source" \
+ SERVER_NAME="$BUILD_SERVER_NAME" \
+ RPM_PACKAGER_URL="$GLANCE_PACKAGER_URL" \
+ RPM_PACKAGER_BRANCH="$GLANCE_PACKAGER_BRANCH" \
+ SOURCE_URL="$GLANCE_URL" \
+ SOURCE_BRANCH="$GLANCE_BRANCH" \
+ GIT_MASTER="$GLANCE_GIT_MASTER" \
+ GIT_MERGE_MASTER_BRANCH="$GLANCE_GIT_MASTER_BRANCH" \
+ MERGE_MASTER="$GLANCE_MERGE_MASTER" \
+ REVISION="$GLANCE_REVISION" \
+ CACHEURL="$RPM_CACHEURL" \
+ || fail "Failed to build glance packages."
+ stop_metric
+
+ start_metric "Build Python-Glanceclient"
+ rake glance:build_python_glanceclient \
+ SERVER_NAME="$BUILD_SERVER_NAME" \
+ SOURCE_URL="$GLANCECLIENT_GIT_MASTER" \
+ RPM_PACKAGER_URL="$GLANCECLIENT_PACKAGER_URL" \
+ CACHEURL="$RPM_CACHEURL" \
+ || fail "Failed to build glanceclient packages."
+ stop_metric
+
+ local KEYSTONE_MERGE_MASTER=""
+ if [[ "$KEYSTONE_MERGE_TRUNK" == "true" ]]; then
+ KEYSTONE_MERGE_MASTER="true"
+ fi
+ start_metric "Build Keystone"
+ rake keystone:build_packages SOURCE_DIR="$TMP_DIR/keystone_source" \
+ SERVER_NAME="$BUILD_SERVER_NAME" \
+ RPM_PACKAGER_URL="$KEYSTONE_PACKAGER_URL" \
+ RPM_PACKAGER_BRANCH="$KEYSTONE_PACKAGER_BRANCH" \
+ SOURCE_URL="$KEYSTONE_URL" \
+ SOURCE_BRANCH="$KEYSTONE_BRANCH" \
+ GIT_MASTER="$KEYSTONE_GIT_MASTER" \
+ GIT_MERGE_MASTER_BRANCH="$KEYSTONE_GIT_MASTER_BRANCH" \
+ MERGE_MASTER="$KEYSTONE_MERGE_MASTER" \
+ REVISION="$KEYSTONE_REVISION" \
+ CACHEURL="$RPM_CACHEURL" \
+ || fail "Failed to build keystone packages."
+ stop_metric
+
+ start_metric "Build Python-Keystoneclient"
+ rake keystone:build_python_keystoneclient \
+ SERVER_NAME="$BUILD_SERVER_NAME" \
+ SOURCE_URL="$KEYSTONECLIENT_GIT_MASTER" \
+ RPM_PACKAGER_URL="$KEYSTONECLIENT_PACKAGER_URL" \
+ CACHEURL="$RPM_CACHEURL" \
+ || fail "Failed to build keystoneclient packages."
+ stop_metric
+
+ if [ -n "$BUILD_SWIFT" ]; then
+ local SWIFT_MERGE_MASTER=""
+ if [[ "$SWIFT_MERGE_TRUNK" == "true" ]]; then
+ SWIFT_MERGE_MASTER="true"
+ fi
+ start_metric "Build Swift"
+ rake swift:build_packages SOURCE_DIR="$TMP_DIR/swift_source" \
+ SERVER_NAME="$BUILD_SERVER_NAME" \
+ RPM_PACKAGER_URL="$SWIFT_PACKAGER_URL" \
+ RPM_PACKAGER_BRANCH="$SWIFT_PACKAGER_BRANCH" \
+ SOURCE_URL="$SWIFT_URL" \
+ SOURCE_BRANCH="$SWIFT_BRANCH" \
+ GIT_MASTER="$SWIFT_GIT_MASTER" \
+ GIT_MERGE_MASTER_BRANCH="$SWIFT_GIT_MASTER_BRANCH" \
+ MERGE_MASTER="$SWIFT_MERGE_MASTER" \
+ REVISION="$SWIFT_REVISION" \
+ CACHEURL="$RPM_CACHEURL" \
+ || fail "Failed to build swift packages."
+ stop_metric
+
+ fi
+
+ start_metric "Build Python-Swiftclient"
+ rake swift:build_python_swiftclient \
+ SERVER_NAME="$BUILD_SERVER_NAME" \
+ SOURCE_URL="$SWIFTCLIENT_GIT_MASTER" \
+ RPM_PACKAGER_URL="$SWIFTCLIENT_PACKAGER_URL" \
+ CACHEURL="$RPM_CACHEURL" \
+ || fail "Failed to build swiftclient packages."
+ stop_metric
+
+ if [ -n "$BUILD_CINDER" ]; then
+ local CINDER_MERGE_MASTER=""
+ if [[ "$CINDER_MERGE_TRUNK" == "true" ]]; then
+ CINDER_MERGE_MASTER="true"
+ fi
+ start_metric "Build Cinder"
+ rake cinder:build_packages SOURCE_DIR="$TMP_DIR/cinder_source" \
+ SERVER_NAME="$BUILD_SERVER_NAME" \
+ RPM_PACKAGER_URL="$CINDER_PACKAGER_URL" \
+ RPM_PACKAGER_BRANCH="$CINDER_PACKAGER_BRANCH" \
+ SOURCE_URL="$CINDER_URL" \
+ SOURCE_BRANCH="$CINDER_BRANCH" \
+ GIT_MASTER="$CINDER_GIT_MASTER" \
+ GIT_MERGE_MASTER_BRANCH="$CINDER_GIT_MASTER_BRANCH" \
+ MERGE_MASTER="$CINDER_MERGE_MASTER" \
+ REVISION="$CINDER_REVISION" \
+ CACHEURL="$RPM_CACHEURL" \
+ || fail "Failed to build cinder packages."
+ stop_metric
+
+ fi
+
+ start_metric "Build Python-Cinderclient"
+ rake cinder:build_python_cinderclient \
+ SERVER_NAME="$BUILD_SERVER_NAME" \
+ SOURCE_URL="$CINDERCLIENT_GIT_MASTER" \
+ RPM_PACKAGER_URL="$CINDERCLIENT_PACKAGER_URL" \
+ CACHEURL="$RPM_CACHEURL" \
+ || fail "Failed to build cinderclient packages."
+ stop_metric
+
+
+ if [ -n "$BUILD_QUANTUM" ]; then
+ local QUANTUM_MERGE_MASTER=""
+ if [[ "$QUANTUM_MERGE_TRUNK" == "true" ]]; then
+ QUANTUM_MERGE_MASTER="true"
+ fi
+ start_metric "Build Quantum"
+ rake quantum:build_packages SOURCE_DIR="$TMP_DIR/quantum_source" \
+ SERVER_NAME="$BUILD_SERVER_NAME" \
+ RPM_PACKAGER_URL="$QUANTUM_PACKAGER_URL" \
+ RPM_PACKAGER_BRANCH="$QUANTUM_PACKAGER_BRANCH" \
+ SOURCE_URL="$QUANTUM_URL" \
+ SOURCE_BRANCH="$QUANTUM_BRANCH" \
+ GIT_MASTER="$QUANTUM_GIT_MASTER" \
+ GIT_MERGE_MASTER_BRANCH="$QUANTUM_GIT_MASTER_BRANCH" \
+ MERGE_MASTER="$QUANTUM_MERGE_MASTER" \
+ REVISION="$QUANTUM_REVISION" \
+ CACHEURL="$RPM_CACHEURL" \
+ || fail "Failed to build quantum packages."
+ stop_metric
+ fi
+
+ start_metric "Build Python-Quantumclient"
+ rake quantum:build_python_quantumclient \
+ SERVER_NAME="$BUILD_SERVER_NAME" \
+ SOURCE_URL="$QUANTUMCLIENT_GIT_MASTER" \
+ RPM_PACKAGER_URL="$QUANTUMCLIENT_PACKAGER_URL" \
+ CACHEURL="$RPM_CACHEURL" \
+ || fail "Failed to build quantumclient packages."
+ stop_metric
+
+ # distro agnostic hook to build custom required packages for upstream
+ rake build_misc SERVER_NAME="$BUILD_SERVER_NAME" \
+ || fail "Failed to build misc packages."
+
+}
+
if [ ! -f ~/.gitconfig ]; then
cat > ~/.gitconfig <<-EOF_GIT_CONFIG_CAT
[user]
Oops, something went wrong.

0 comments on commit c8c1bd8

Please sign in to comment.