source: flex_extract.git/setup.sh @ c19256e

ctbtodev
Last change on this file since c19256e was 50f9ca6, checked in by Anne Philipp <anne.philipp@…>, 4 years ago

BUGFIX (ticket #263): Corrected installation check for parameters GATEWAY and DESTINATION

  • Property mode set to 100755
File size: 2.7 KB
RevLine 
[2fb99de]1#!/bin/bash
2#
3# @Author: Anne Philipp
4#
5# @Date: September, 10 2018
6#
7# @Description:
[433d1eb]8#    This file defines the flex_extract's available installation
9#    parameters and puts them together for the call of the actual
[afbd3a1]10#    python installation script. It also does some checks to
11#    guarantee necessary parameters were set.
12#
13# @Licence:
14#    (C) Copyright 2014-2019.
15#
16#    SPDX-License-Identifier: CC-BY-4.0
17#
18#    This work is licensed under the Creative Commons Attribution 4.0
19#    International License. To view a copy of this license, visit
20#    http://creativecommons.org/licenses/by/4.0/ or send a letter to
21#    Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
[2fb99de]22#
23# -----------------------------------------------------------------
24# AVAILABLE COMMANDLINE ARGUMENTS TO SET
25#
[433d1eb]26# THE USER HAS TO SPECIFY THESE PARAMETERS
[2fb99de]27#
28TARGET='ecgate'
[d2b7217]29MAKEFILE='makefile_ecgate'
[f7b9666]30ECUID='<username>'
31ECGID='<groupID>'
32GATEWAY='<gatewayname>'
[50f9ca6]33DESTINATION='<username>@genericSftp'
[433d1eb]34INSTALLDIR=None
35JOB_TEMPLATE=''
36CONTROLFILE='CONTROL_EA5'
[2fb99de]37# -----------------------------------------------------------------
38#
39# AFTER THIS LINE THE USER DOES NOT HAVE TO CHANGE ANYTHING !!!
40#
41# -----------------------------------------------------------------
42
43# PATH TO INSTALLATION SCRIPT
[ba99230]44script="Source/Python/install.py"
[2fb99de]45
46# INITIALIZE EMPTY PARAMETERLIST
47parameterlist=""
48
49# DEFAULT PARAMETERLIST
50if [ -n "$TARGET" ]; then
51  parameterlist=" --target=$TARGET"
52else
53  echo "ERROR: No installation target specified."
54  echo "EXIT WITH ERROR"
55  exit
56fi
57
58# CHECK FOR MORE PARAMETER
59if [ "$TARGET" == "ecgate" ] || [ "$TARGET" == "cca" ]; then
60  # check if necessary Parameters are set
[50f9ca6]61  if [ -z "$ECUID" ] || [ -z "$ECGID" ] || [ "$ECUID" == "<username>" ] || [ "$ECGID" == "<groupID>" ] ; then
62    echo "ERROR: At least one of the following parameters are not properly set: ECUID or ECGID!"
[2fb99de]63    echo "EXIT WITH ERROR"
64    exit
65  else
66    parameterlist+=" --ecuid=$ECUID --ecgid=$ECGID --gateway=$GATEWAY --destination=$DESTINATION"
67  fi
[50f9ca6]68  if [ -z "$GATEWAY" ] || [ -z "$DESTINATION" ] || [ "$GATEWAY" == "<gatewayname>" ] || [ "$DESTINATION" == "<username>@genericSftp" ] ; then
69    echo "WARNING: Not setting parameters GATEWAY and DESTINATION means there will be no file transfer to local gateway server."
70  fi
[2fb99de]71fi
72if [ -n "$MAKEFILE" ]; then
73  parameterlist+=" --makefile=$MAKEFILE"
74fi
[83b8e3c]75if [ -n "$FLEXPARTDIR" ]; then # not empty
76  parameterlist+=" --flexpartdir=$FLEXPARTDIR"
[2fb99de]77fi
78if [ -n "$JOB_TEMPLATE" ]; then
79  parameterlist+=" --job_template=$JOB_TEMPLATE"
80fi
81if [ -n "$CONTROLFILE" ]; then
82  parameterlist+=" --controlfile=$CONTROLFILE"
83fi
84
85# -----------------------------------------------------------------
86# CALL INSTALLATION SCRIPT WITH DETERMINED COMMANDLINE ARGUMENTS
87
88$script $parameterlist
89
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG