setup_step.sh 779 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/env bash

function usage() {
    echo "Usage: "
    echo "    setup_step.sh -h/--help"
    echo "    setup_step.sh <STEP-NAME>"

}

# Process command line options
shortopts="h"
longopts="help"
opts=$(getopt -o "$shortopts" -l "$longopts" -n "$(basename $0)" -- "$@")
if [ $? -eq 0 ]; then
    #eval set -- ${opts}
    eval "set -- ${opts}"
    while [ $# -gt 0 ]; do
        case "$1" in
            ( --        ) shift; break;;
            ( -h|--help ) usage; exit 2; shift; break;;
        esac
    done
else
    usage; exit 2;
fi

STEP_NAME=$1

if [[ "${STEP_NAME}" == "" ]];
then
    echo "STEP: ${STEP_NAME}"
    usage; exit 2;
fi;    

PIPE_ROOT=`pwd`

37
source ${PIPE_ROOT}/pipe-env.sh
38
39
40
41
42
source ${PIPE_ROOT}/src/setup.sh

setup_step ${PIPE_ROOT} ${STEP_NAME}

exit $?