Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@imesh
Last active January 1, 2016 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imesh/8134167 to your computer and use it in GitHub Desktop.
Save imesh/8134167 to your computer and use it in GitHub Desktop.
Upload Apache Stratos (incubating) binary packages to Apache Dist
#!/bin/bash
# ------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ------------------------------------------------------------------
# Upload Apache Stratos (incubating) binary packages to Apache Dist
# ------------------------------------------------------------------
set -e
stratos_version=4.0.0-SNAPSHOT
milestone_version=4.0.0-incubating-m5
source_path=/home/imesh/dev/apache/stratos/trunk/incubator-stratos
dist_path=/home/imesh/dev/apache/stratos/dist/apache-dist/milestones/$milestone_version
cc_pack=apache-stratos-cc-$stratos_version.zip
cc_path=$source_path/products/cloud-controller/modules/distribution/target/$cc_pack
as_pack=apache-stratos-autoscaler-$stratos_version.zip
as_path=$source_path/products/autoscaler/modules/distribution/target/$as_pack
sc_pack=apache-stratos-sc-$stratos_version.zip
sc_path=$source_path/products/stratos-controller/modules/distribution/target/$sc_pack
lb_pack=apache-stratos-load-balancer-$stratos_version.zip
lb_path=$source_path/products/load-balancer/modules/distribution/target/$lb_pack
ca_pack=apache-stratos-cartridge-agent-$stratos_version-bin.zip
ca_path=$source_path/products/cartridge-agent/modules/distribution/target/$ca_pack
ha_pack=apache-stratos-haproxy-extension-$stratos_version-bin.zip
ha_path=$source_path/extensions/load-balancer/haproxy-extension/target/$ha_pack
echo "Validating package files"
if [ ! -f $cc_path ]; then
echo "Package not found: $cc_path"
fi
if [ ! -f $as_path ]; then
echo "Package not found: $as_path"
fi
if [ ! -f $sc_path ]; then
echo "Package not found: $sc_path"
fi
if [ ! -f $lb_path ]; then
echo "Package not found: $lb_path"
fi
if [ ! -f $ca_path ]; then
echo "Package not found: $ca_path"
fi
if [ ! -f $ha_path ]; then
echo "Package not found: $ha_path"
fi
echo "Validation succeeded"
pushd $dist_path
echo "Uploading cloud controller"
cp -fv $cc_path .
svn add $cc_pack
svn commit -m "Adding cloud controller $milestone_version binary package"
echo "Cloud controller uploaded"
echo "Uploading autoscaler"
cp -fv $as_path .
svn add $as_pack
svn commit -m "Adding autoscaler $milestone_version binary package"
echo "Autoscaler uploaded"
echo "Uploading stratos controller"
cp -fv $sc_path .
svn add $sc_pack
svn commit -m "Adding stratos controller $milestone_version binary package"
echo "Stratos controller uploaded"
echo "Uploading load balancer"
cp -fv $lb_path .
svn add $lb_pack
svn commit -m "Adding load balancer $milestone_version binary package"
echo "Load balancer uploaded"
echo "Uploading cartridge agent"
cp -fv $ca_path .
svn add $ca_pack
svn commit -m "Adding cartridge agent $milestone_version binary package"
echo "Cartridge agent uploaded"
echo "Uploading ha-proxy extension"
cp -fv $ha_path .
svn add $ha_pack
svn commit -m "Adding ha-proxy extension $milestone_version binary package"
echo "ha-proxy extension uploaded"
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment