Skip to content

Instantly share code, notes, and snippets.

@jarretraim
Created October 15, 2013 03:19
Show Gist options
  • Select an option

  • Save jarretraim/6986021 to your computer and use it in GitHub Desktop.

Select an option

Save jarretraim/6986021 to your computer and use it in GitHub Desktop.
Storm Packaging Script
#!/usr/bin/env bash
useradd -r -U -s /bin/false -g storm storm
#!/usr/bin/env bash
chown -R storm:storm /usr/local/storm/
#!/usr/bin/env bash
SOURCE='-s dir'
TARGET='-t deb'
CONFIG='--config-files conf/storm.yaml'
VERSION='-v 0.8.2'
OUTPUT='-p pkg'
MAINTAINER='-m "Jarret Raim <jarret.raim@rackspace.com>"'
BEFORE_INSTALL='--before-install pkg/add_storm_user.sh'
AFTER_INSTALL='--after-install pkg/change-ownership.sh'
DEPENDENCIES=(
'python-2.7'
'openjdk-7-jdk'
'unzip'
'supervisor'
)
for i in "${DEPENDENCIES[@]}"
do
DEPS="$DEPS -d $i"
done
ROOT_INSTALL_DIR="/usr/local/storm"
MAPPINGS=(
"conf/storm.yaml=/etc/storm"
"lib=$ROOT_INSTALL_DIR/lib"
"log4j=$ROOT_INSTALL_DIR/log4j"
"bin=$ROOT_INSTALL_DIR/bin"
"public=$ROOT_INSTALL_DIR/public"
)
for i in "${MAPPINGS[@]}"
do
MAP="$MAP $i"
done
function build {
# Expects:
# $1 name
# $2 supervisor config file mapping
echo "Building $1"
echo fpm $SOURCE $TARGET -n $1 -f $VERSION $DEPS $BEFORE_INSTALL $AFTER_INSTALL $CONFIG $MAP $2
fpm $SOURCE $TARGET -n $1 -f $VERSION $DEPS $BEFORE_INSTALL $AFTER_INSTALL $CONFIG $MAP $2
}
# Build 'dem packages
cd ..
build "storm-ui" "pkg/storm-ui.conf"
build "storm-nimbus" "pkg/storm-nimbus.conf"
build "storm-supervisor" "pkg/storm-supervisor.conf"
[program:storm-nimbus]
command=/usr/local/storm/bin/storm nimbus
numprocs=1
autostart=true
directory=/usr/local/storm
process_name=storm-nimbus
[program:storm-supervisor]
command=/usr/local/storm/bin/storm supervisor
numprocs=1
autostart=true
directory=/usr/local/storm
process_name=storm-supervisor
[program:storm-ui]
command=/usr/local/storm/bin/storm ui
numprocs=1
autostart=true
directory=/usr/local/storm
process_name=storm-ui
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment