diff options
author | Magnus Feuer <mfeuer@jaguarlandrover.com> | 2015-11-21 16:55:12 -0800 |
---|---|---|
committer | Magnus Feuer <mfeuer@jaguarlandrover.com> | 2015-11-21 16:55:12 -0800 |
commit | 3a20849c94020afba5f0384cc9979d02a7546762 (patch) | |
tree | e0baaeb37660f4e08a326dc81abf234799f82196 | |
parent | e263db99b07b68ab018553bbd3a330301dd81668 (diff) | |
download | rvi_core-3a20849c94020afba5f0384cc9979d02a7546762.tar.gz |
Replaced by rvi_install
-rwxr-xr-x | scripts/setup_rvi_node.sh | 130 |
1 files changed, 0 insertions, 130 deletions
diff --git a/scripts/setup_rvi_node.sh b/scripts/setup_rvi_node.sh deleted file mode 100755 index 5dfe55f..0000000 --- a/scripts/setup_rvi_node.sh +++ /dev/null @@ -1,130 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2014, Jaguar Land Rover -# -# This program is licensed under the terms and conditions of the -# Mozilla Public License, version 2.0. The full text of the -# Mozilla Public License is at https://www.mozilla.org/MPL/2.0/ -# - -# -# Setup an RVI release with a configuration file. -# -# This script will setup a directory with with the same name -# as the release name. The script uses Ulf Wiger's setup application -# (github.com/Feuerlabs/setup) to generate the release. -# -# With the -d argument, a developer release will be built with -# only -# -# Once setup, the RVI node can be started with ./rvi_node <release_na,e? -# -# Please note that the generated release will depend on the built -# -# In order to create a standalone release, use create_rvi_release.sh -# - -SELF_DIR=$(dirname $(readlink -f "$0")) -SETUP_GEN=$SELF_DIR/setup_gen # Ulf's kitchen sink setup utility - -usage() { - echo "Usage: $0 [-d] -n node_name -c config_file" - echo " -n node_name Specify the name of the rvi node to setup" - echo - echo " -c config_file Specifies the setup config file to use when setting " - echo " up the node" - echo - echo " -d Create a development release. See below." - echo - echo "The generated node will be created in a subdirectory with the same" - echo "name as the node name." - echo - echo "The created node can be started with: $SELF_DIR/rvi_node -n node_name" - echo - echo "If the node was created with the -d flag, you need to start" - echo "the node with $SELF_DIR/rvi_node -d -n node_name" - echo - echo "Configuration file examples can be found in hvac_demo/vehicle.config" - echo - echo "The -d flag creates a development release that uses the erlang " - echo "binaries found in ebin/ and deps/*/ebin. This means that new builds," - echo "created by make, can be run directly through " - echo "$SELF_DIR/rvi_node -n node_name without having to run ./setup_rvi_node.sh ." - echo - echo "If the -d flag is omitted, the release will be self-contained in the " - echo "newly created subdirectory rel/[node_name]." - echo "This directory, containing a standard erlang reltool release, " - echo "including the erlang runtime system, can be copied as a stand alone" - echo "system to a destination node." - echo - echo "Configuration file examples can be found in hvac_demo/vehicle.config" - exit 1 -} - - -build_type=rel -while getopts "dn:c:" o; do - case "${o}" in - n) - NODE_NAME=${OPTARG} - ;; - c) - CONFIG_NAME=${OPTARG} - ;; - d) - build_type=dev - ;; - - *) - usage - ;; - esac -done - -if [ -z "${NODE_NAME}" ] ; then - echo "Missing -n flag" - usage -fi -if [ -z "${CONFIG_NAME}" ] ; then - echo "Missing -c flag" - usage -fi - - -export ERL_LIBS=$PWD/components:$PWD/deps:$ERL_LIBS:$PWD -echo "Setting up node $NODE_NAME." -rm -rf $NODE_NAME -$SETUP_GEN $NODE_NAME $CONFIG_NAME $NODE_NAME - -if [ "${build_type}" = "dev" ] -then - echo "RVI Node $NODE_NAME has been setup." - echo "Launch with $SELF_DIR/rvi_node.sh -n $NODE_NAME" - exit -else - echo "Building stand alone release for $NODE_NAME" - # Copy the newly created config file. - rm -rf rel/$NODE_NAME - cp $NODE_NAME/sys.config rel/files/sys.config - ./rebar generate - # Rename the release after the node name - if [ ${NODE_NAME} != "rvi" ] - then - mv rel/rvi rel/$NODE_NAME - fi - echo "Stand alone release for $NODE_NAME created under project " - echo "root directory's ./rel/$NODE_NAME." - echo - echo "Start: ./rel/$NODE_NAME/bin/rvi start" - echo "Attach console: ./rel/$NODE_NAME/bin/rvi attach" - echo "Stop: ./rel/$NODE_NAME/bin/rvi stop" - echo "Start console mode: ./rel/$NODE_NAME/bin/rvi console" - echo - echo "Start dev mode: ./rvi_node.sh -n $NODE_NAME" - echo - echo "./rel/$NODE_NAME can be copied and installed on its destination host." - -fi - -exit 0 - |