Cross Reference: rebuild-ontohub
xref
: /
forgerock
/
openam-v13
/
openam-console
/
src
/
main
/
webapp
/
console
/
policy
/
IdentityMembershipConditionEdit.jsp
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
rebuild-ontohub revision 37cc69ff6c896d2259221d7f912c3a4113cbfccb
346
N/A
#!/
bin
/
bash
346
N/A
346
N/A
abort_unless_invoker_installed
()
{
346
N/A
result
=
"
$(
which
invoker
2
>&
1
)
"
346
N/A
if
[[
"$?"
-
ne
"0"
]];
then
346
N/A
echo
">>> Invoker not installed, please install"
346
N/A
exit
1
346
N/A
fi
346
N/A
}
346
N/A
346
N/A
initialize_new_invoker_instance
()
{
346
N/A
result
=
"
$(
invoker
list
2
>&
1
)
"
346
N/A
if
[[
"$?"
-
eq
"0"
]];
then
346
N/A
echo
">>> Invoker running, restarting..."
346
N/A
result
=
`
invoker
stop
2
>&
1
`
346
N/A
else
346
N/A
echo
">>> Invoker not running, starting..."
346
N/A
fi
346
N/A
invoker
start
invoker.ini
--
daemon
346
N/A
}
346
N/A
346
N/A
execute_or_die
()
{
3817
N/A
cmd
=
"$1"
346
N/A
echo
">>> Executing '
$cmd
'"
346
N/A
result
=
"
$(
$cmd
2
>&
1
)
"
3817
N/A
state
=
"$?"
3817
N/A
if
[[
"
$state
"
-
ne
"0"
]];
then
3817
N/A
echo
"
$result
"
346
N/A
echo
">>> Failed to execute '
$cmd
', aborting further commands."
346
N/A
exit
1
4162
N/A
fi
783
N/A
}
1244
N/A
4162
N/A
abort_unless_invoker_installed
618
N/A
initialize_new_invoker_instance
1244
N/A
1244
N/A
for
i
in
"$@"
;
do
4162
N/A
case
$i
in
844
N/A
-d|--
download
-
fixtures
)
4162
N/A
export
DOWNLOAD_FIXTURES
=
true
618
N/A
;;
1258
N/A
-r|--
restart
)
346
N/A
RESTART_INVOKER_ONLY
=
true
346
N/A
;;
346
N/A
*)
346
N/A
# unknown option
4162
N/A
;;
844
N/A
esac
4162
N/A
shift
618
N/A
done
4194
N/A
4194
N/A
if
[[ !
(
$RESTART_INVOKER_ONLY
)
]];
then
346
N/A
execute_or_die
"bundle exec rake elasticsearch:wipe"
346
N/A
execute_or_die
"bundle exec rake db:migrate:clean"
346
N/A
execute_or_die
"redis-cli flushdb"
346
N/A
execute_or_die
"bundle exec rake git:compile_cp_keys"
4162
N/A
execute_or_die
"bundle exec rake db:seed"
844
N/A
fi
4162
N/A