Repository navigation
Expand file tree
/
Copy pathmakegate.csh
More file actions
executable file
·115 lines (95 loc) · 2.78 KB
/
Copy pathmakegate.csh
File metadata and controls
executable file
·115 lines (95 loc) · 2.78 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#! /bin/csh -f
echo $0 $*
#set echo
if ( ! $?WORKFLOW_DATA ) then
echo WORKFLOW_DATA environment variable is undefined
exit 1
endif
if ( ! $?WORKFLOW_DIR ) then
echo WORKFLOW_DIR environment variable is undefined
exit 1
endif
# Call with gatename, seriesname, key, and type as key=value pairs
# gate=<gatename> ds=<seriesname> key=<primekey> type=<typename>
# where typename is one of "time", "sn", ...
# Any of the following keywords can be set on the calling line.
# set defaults and collect args
set gate_name = "NOT_SPECIFIED"
set product = "NOT_SPECIFIED"
set gatestatus = "HOLD"
set low = NaN #
set high = NaN #
set type = "NOT_SPECIFIED"
set key = "NOT_SPECIFIED"
set lastupdate = 1993 #
set nextupdate = `date +%Y.%m.%d_%H:%M:%S` #
set updatedelta = 86400
set statustask = scripts/statustask.csh
set actiontask = "NOT_SPECIFIED"
set project = "NA"
set coverage_args = "none"
while ( $#argv > 0)
foreach keyname (gate_name gatestatus product sequence_number low high type key lastupdate nextupdate updatedelta statustask actiontask project)
if ($1 =~ $keyname=*) then
set $1
endif
end # foreach
shift
end #while
if ("$gate_name" == "NOT_SPECIFIED") then
echo gate_name must be specified
exit
endif
if ("$product" == "NOT_SPECIFIED") then
echo product must be specified
exit
endif
if ("$type" == "NOT_SPECIFIED") then
echo type must be specified
exit
endif
if ("$key" == "NOT_SPECIFIED") then
echo key must be specified
exit
endif
if ("$actiontask" == "NOT_SPECIFIED") then
echo warning - actiontask is not specified
endif
if (!(-x $WORKFLOW_DIR/$statustask)) then
echo STOP, the script/program statustask should be created and executable before a gate that uses it is created.
exit
endif
if (!(-x $WORKFLOW_DATA/tasks/$actiontask)) then
echo STOP, the command $actiontask should be created before a gate that uses it is created.
exit
endif
set isdash = `echo $gate_name | grep '-' | wc -l`
if ($isdash) then
echo STOP, the gatename may not contain a dash, $gate_name
exit
endif
set sequence_number = $gate_name"-19930101-000" # gate sequence number
cd $WORKFLOW_DATA
if (-e gates/$gate_name) then
echo gate $gate_name already exists, remove then repeat command
exit
endif
mkdir gates/$gate_name
cd gates/$gate_name
echo "$gate_name" > gate_name
echo "$product" > product
echo "$gatestatus" > gatestatus
echo $sequence_number >sequence_number
echo "$low" > low
echo "$high" > high
echo "$type" > type
echo "$key" > key
echo "$lastupdate" > lastupdate
echo "$nextupdate" > nextupdate
echo "$updatedelta" > updatedelta
echo "$statustask" > statustask
echo "$actiontask" > actiontask
echo "$project" > project
echo "$coverage_args" > coverage_args
mkdir new_tickets
mkdir active_tickets