source: flex_extract.git/setup_reading.sh

dev
Last change on this file was 78d1f9d, checked in by Anne Tipka <anne.tipka@…>, 18 months ago

backup for Reading setup files; linking old setup file names to Bologna versions

  • Property mode set to 100755
File size: 2.9 KB
Line 
1#!/bin/bash
2#
3# @Author: Anne Philipp
4#
5# @Date: September, 10 2018
6#
7# @Description:
8#    This file defines the flex_extract's available installation
9#    parameters and puts them together for the call of the actual
10#    python installation script. It also does some checks to
11#    guarantee necessary parameters were set.
12#
13# @Licence:
14#    (C) Copyright 2014-2020.
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.
22#
23# -----------------------------------------------------------------
24# AVAILABLE COMMANDLINE ARGUMENTS TO SET
25#
26# THE USER HAS TO SPECIFY THESE PARAMETERS
27#
28TARGET='ecgate'
29MAKEFILE='makefile_ecgate'
30ECUID='<username>'
31ECGID='<groupID>'
32GATEWAY='<gatewayname>'
33DESTINATION='<username>@genericSftp'
34INSTALLDIR=None
35JOB_TEMPLATE=''
36CONTROLFILE='CONTROL_EA5'
37# -----------------------------------------------------------------
38#
39# AFTER THIS LINE THE USER DOES NOT HAVE TO CHANGE ANYTHING !!!
40#
41# -----------------------------------------------------------------
42
43# PATH TO INSTALLATION SCRIPT
44script="Source/Python/install.py"
45
46# INITIALIZE EMPTY PARAMETERLIST
47parameterlist=""
48
49# CHECK IF ON ECMWF SERVER;
50if [[ $HOST == *"ecgb"* ]] || [[ $HOST == *"cca"* ]] || [[ $HOST == *"ccb"* ]]; then
51# LOAD PYTHON3 MODULE
52  module load python3
53fi 
54
55# DEFAULT PARAMETERLIST
56if [ -n "$TARGET" ]; then
57  parameterlist=" --target=$TARGET"
58else
59  echo "ERROR: No installation target specified."
60  echo "EXIT WITH ERROR"
61  exit
62fi
63
64# CHECK FOR MORE PARAMETER
65if [ "$TARGET" == "ecgate" ] || [ "$TARGET" == "cca" ] || [ "$TARGET" == "ccb" ]; then
66  # check if necessary Parameters are set
67  if [ -z "$ECUID" ] || [ -z "$ECGID" ] || [ "$ECUID" == "<username>" ] || [ "$ECGID" == "<groupID>" ] ; then
68    echo "ERROR: At least one of the following parameters are not properly set: ECUID or ECGID!"
69    echo "EXIT WITH ERROR"
70    exit
71  else
72    parameterlist+=" --ecuid=$ECUID --ecgid=$ECGID --gateway=$GATEWAY --destination=$DESTINATION"
73  fi
74  if [ -z "$GATEWAY" ] || [ -z "$DESTINATION" ] || [ "$GATEWAY" == "<gatewayname>" ] || [ "$DESTINATION" == "<username>@genericSftp" ] ; then
75    echo "WARNING: Not setting parameters GATEWAY and DESTINATION means there will be no file transfer to local gateway server."
76  fi
77fi
78if [ -n "$MAKEFILE" ]; then
79  parameterlist+=" --makefile=$MAKEFILE"
80fi
81if [ -n "$FLEXPARTDIR" ]; then # not empty
82  parameterlist+=" --flexpartdir=$FLEXPARTDIR"
83fi
84if [ -n "$JOB_TEMPLATE" ]; then
85  parameterlist+=" --job_template=$JOB_TEMPLATE"
86fi
87if [ -n "$CONTROLFILE" ]; then
88  parameterlist+=" --controlfile=$CONTROLFILE"
89fi
90
91# -----------------------------------------------------------------
92# CALL INSTALLATION SCRIPT WITH DETERMINED COMMANDLINE ARGUMENTS
93
94$script $parameterlist
95
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG