Skip to content

Instantly share code, notes, and snippets.

@imesh
Created April 26, 2014 06:01
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/11312860 to your computer and use it in GitHub Desktop.
Save imesh/11312860 to your computer and use it in GitHub Desktop.
Copy Stratos packs from dist to packages folder and puppet master
set -e
source_path="/mnt/dist/4.0.0-incubating-rc1"
stratos_version=4.0.0-incubating
dist_path="/home/ubuntu/packages"
puppet_master_path=/etc/puppet
stratos_pack=apache-stratos-$stratos_version.zip
stratos_path=$source_path/$stratos_pack
lb_pack=apache-stratos-load-balancer-$stratos_version.zip
lb_path=$source_path/$lb_pack
ca_pack=apache-stratos-cartridge-agent-$stratos_version-bin.zip
ca_path=$source_path/$ca_pack
ha_pack=apache-stratos-haproxy-extension-$stratos_version-bin.zip
ha_path=$source_path/$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