source: flex_extract.git/setup_local_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# @History:
14#    Leopold Haimberger; Aug 2020
15#       added new parameter for a system installation
16#       (seperate executable and user directories)
17#
18# @Licence:
19#    (C) Copyright 2014-2020.
20#
21#    SPDX-License-Identifier: CC-BY-4.0
22#
23#    This work is licensed under the Creative Commons Attribution 4.0
24#    International License. To view a copy of this license, visit
25#    http://creativecommons.org/licenses/by/4.0/ or send a letter to
26#    Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
27#
28# -----------------------------------------------------------------
29# AVAILABLE COMMANDLINE ARGUMENTS TO SET
30#
31# THE USER HAS TO SPECIFY THESE PARAMETERS
32#
33TARGET='local'
34MAKEFILE='makefile_local_gfortran'
35ECUID='<username>'
36ECGID='<groupID>'
37GATEWAY='<gatewayname>'
38DESTINATION='<name>@genericSftp'
39INSTALLDIR=None
40SYSINSTALLDIR=None
41JOB_TEMPLATE=''
42CONTROLFILE='CONTROL_CERA'
43# -----------------------------------------------------------------
44#
45# AFTER THIS LINE THE USER DOES NOT HAVE TO CHANGE ANYTHING !!!
46#
47# -----------------------------------------------------------------
48
49# PATH TO INSTALLATION SCRIPT
50script="Source/Python/install.py"
51
52# INITIALIZE EMPTY PARAMETERLIST
53parameterlist=""
54
55# CHECK IF ON ECMWF SERVER;
56if [[ $HOST == *"ecgb"* ]] || [[ $HOST == *"cca"* ]] || [[ $HOST == *"ccb"* ]]; then
57# LOAD PYTHON3 MODULE
58  module load python3
59fi 
60
61# DEFAULT PARAMETERLIST
62if [ -n "$TARGET" ]; then
63  parameterlist=" --target=$TARGET"
64else
65  echo "ERROR: No installation target specified."
66  echo "EXIT WITH ERROR"
67  exit
68fi
69
70# CHECK FOR MORE PARAMETER
71if [ "$TARGET" == "ecgate" ] || [ "$TARGET" == "cca" ]; then
72  # check if necessary Parameters are set
73  if [ -z "$ECUID" ] || [ -z "$ECGID" ] || [ -z "$GATEWAY" ] || [ -z "$DESTINATION" ]; then
74    echo "ERROR: At least one of the following parameters are not set: ECUID, ECGID, GATEWAY, DESTINATION!"
75    echo "EXIT WITH ERROR"
76    exit
77  else
78    parameterlist+=" --ecuid=$ECUID --ecgid=$ECGID --gateway=$GATEWAY --destination=$DESTINATION"
79  fi
80fi
81if [ -n "$MAKEFILE" ]; then
82  parameterlist+=" --makefile=$MAKEFILE"
83fi
84if [ -n "$INSTALLDIR" ]; then 
85  parameterlist+=" --installdir=$INSTALLDIR"
86fi
87if [ -n "$SYSINSTALLDIR" ]; then 
88  parameterlist+=" --sysinstalldir=$SYSINSTALLDIR"
89fi
90if [ -n "$JOB_TEMPLATE" ]; then
91  parameterlist+=" --job_template=$JOB_TEMPLATE"
92fi
93if [ -n "$CONTROLFILE" ]; then
94  parameterlist+=" --controlfile=$CONTROLFILE"
95fi
96
97# -----------------------------------------------------------------
98# CALL INSTALLATION SCRIPT WITH DETERMINED COMMANDLINE ARGUMENTS
99
100$script $parameterlist
101
102
103
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG