Skip to content

Instantly share code, notes, and snippets.

@imesh
Last active August 29, 2015 13:59
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/10815468 to your computer and use it in GitHub Desktop.
Save imesh/10815468 to your computer and use it in GitHub Desktop.
#!/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.
# -----------------------------------------------------------------
# Copy Apache Stratos (incubating) packages to a local dist
# -----------------------------------------------------------------
set -e
source_path="/home/ubuntu/source/incubator-stratos"
stratos_version=4.0.0-SNAPSHOT
dist_path="/home/ubuntu/packages"
puppet_master_path=/etc/puppet
stratos_pack=apache-stratos-$stratos_version.zip
stratos_path=$source_path/products/stratos/modules/distribution/target/$stratos_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 $stratos_path ]; then
echo "Package not found: $stratos_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"
echo "Copying stratos package to dist"
cp -fv $stratos_path $dist_path
echo "Stratos package copied to dist"
echo "Copying load balancer to dist"
cp -fv $lb_path $dist_path
echo "Load balancer copied to dist"
echo "Copying cartridge agent to dist"
cp -fv $ca_path $dist_path
echo "Cartridge agent copied to dist"
echo "Copying ha-proxy extension to dist"
cp -fv $ha_path $dist_path
echo "ha-proxy extension copied to dist"
echo "All packages copied to dist"
echo "Copying load balancer to puppet master"
cp -fv $lb_path $puppet_master_path/modules/lb/files/
echo "Load balancer copied to dist"
echo "Copying cartridge agent to puppet master"
cp -fv $ca_path $puppet_master_path/modules/agent/files/
echo "Cartridge agent copied to dist"
echo "Load balancer and cartridge agent packages copied to puppet master"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment