Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
csbase-dev
sgarest-daemon
Commits
ca933aad
Commit
ca933aad
authored
5 years ago
by
Gabriel Manhães
Browse files
Options
Download
Patches
Plain Diff
Receber parâmetro --sga-name no sgad.sh [SOMA-3827][SOMA-4070]
parent
0516a6b6
master
maia/4208/FixInvalidPropTestInCiCd
maia/9022/SgaCygwinInstall
maia/9564/DisableKubernetesDeploy
newfeature/SOMA-3699_IdentificarVersaoSGA
newfeature/SOMA-4444_AddSgaToK8s
1.7.9
1.7.8
1.7.7
1.7.6
1.7.5
1.7.4
1.7.3
1.7.2
1.7.1
1.7.0
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sgad
+1
-1
sgad
sgad.sh
+24
-9
sgad.sh
with
25 additions
and
10 deletions
+25
-10
sgad
+
1
−
1
View file @
ca933aad
...
...
@@ -20,7 +20,7 @@ local function script_path()
return
str
:
match
(
"(.*)/"
)
or
"."
end
local
config
,
err
=
configuration
.
read
(
args
[
1
]
or
os.getenv
(
"SGAD_CONFIG_FILE"
)
or
script_path
()
..
"/sgad.cfg"
)
local
config
,
err
=
configuration
.
read
(
args
[
1
]
or
os.getenv
(
"SGAD_CONFIG_FILE"
)
or
script_path
()
..
"/sgad.cfg"
,
args
[
2
]
)
if
not
config
then
io.stderr
:
write
(
err
..
"
\n
"
)
os.exit
(
1
)
...
...
This diff is collapsed.
Click to expand it.
sgad.sh
+
24
−
9
View file @
ca933aad
#!/bin/sh
#!/bin/
ba
sh
timestamp
=
$(
date
+%Y%m%d%H%M%S
)
logsdir
=
"logs"
...
...
@@ -6,13 +6,6 @@ logsdir="logs"
[
!
-e
$logsdir
]
&&
echo
"mkdir
$logsdir
"
&&
mkdir
$logsdir
logfile
=
"logs/sgad_
${
timestamp
}
.log"
configfile
=
${
1
}
if
[
-z
${
configfile
}
]
;
then
echo
"Using default file configuration"
>
${
logfile
}
;
configfile
=
sgad.cfg
fi
hostruntimedir
=
"/tmp/chuva"
sgadruntimedir
=
"
${
hostruntimedir
}
/sgad"
runtimesandboxdir
=
"
${
sgadruntimedir
}
/sandbox"
...
...
@@ -21,6 +14,28 @@ runtimesandboxdir="${sgadruntimedir}/sandbox"
[
!
-e
$sgadruntimedir
]
&&
echo
"mkdir
$sgadruntimedir
..."
&&
mkdir
$sgadruntimedir
[
!
-e
$runtimesandboxdir
]
&&
echo
"mkdir
$runtimesandboxdir
..."
&&
mkdir
$runtimesandboxdir
POSITIONAL
=()
# Array para salvar argumentos passados ao comando
while
[[
$#
-gt
0
]]
# Percorre todos argumentos
do
case
"
$1
"
in
--sga-name
)
sga_name
=
$2
shift
shift
;;
*
)
POSITIONAL+
=(
"
$1
"
)
shift
;;
esac
done
set
--
"
${
POSITIONAL
[@]
}
"
# Reseta a posição do $N que foi shiftada
config_file
=
$1
# Como shiftamos todos os argumentos para a direita, nosso $1 sempre vai ser o argumento config_file, se ele existir
if
[
-z
${
config_file
}
]
;
then
echo
"Using default file configuration"
>
${
logfile
}
;
config_file
=
sgad.cfg
fi
eval
$(
luarocks path
--bin
)
sgad
${
configfile
}
2>&1 |
tee
-a
"
${
logfile
}
"
sgad
${
config
_
file
}
${
sga_name
}
2>&1 |
tee
-a
"
${
logfile
}
"
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets