Commit a12947ef authored by Idriss Neumann's avatar Idriss Neumann
Browse files

Fix: verbose opt

parent c542c526
Pipeline #2921 failed with stage
in 2 minutes and 34 seconds
......@@ -4,7 +4,7 @@ stages:
covid-stats-x86:
stage: publish
script:
- setsid ./ci/docker-deliver.sh "x86" "covid-stats" "1.3"
- setsid ./ci/docker-deliver.sh "x86" "covid-stats" "1.4"
only:
refs:
- /^(master.*)$/
......@@ -17,7 +17,7 @@ covid-stats-x86:
covid-stats-arm:
stage: publish
script:
- setsid ./ci/docker-deliver.sh "arm" "covid-stats" "1.3"
- setsid ./ci/docker-deliver.sh "arm" "covid-stats" "1.4"
only:
refs:
- /^(master.*)$/
......
......@@ -2,7 +2,7 @@ version: "3.3"
services:
covid-stats-x86:
image: comworkio/covid-stats:1.3-arm
image: comworkio/covid-stats:1.4-arm
environment:
- ELASTIC_URL=http://es01:9200
- ELASTIC_AUTHENTICATION=disabled
......@@ -11,13 +11,32 @@ services:
networks:
- covid19
es01:
image: comworkio/elasticsearch:7.9.1-1.5-arm
image: comworkio/elasticsearch:7.9.1-1.6-arm
container_name: es01
ports:
- 9200:9200
- 9300:9300
networks:
- covid19
volumes:
- data01:/usr/share/elasticsearch/data
kib01:
image: comworkio/kibana:7.9.1-1.5-arm
container_name: kib01
ports:
- 5601:5601
environment:
- ES_PROTO=http
- ES_HOST=es01
- ES_PORT=9200
networks:
- covid19
depends_on:
- es01
volumes:
data01:
driver: local
networks:
covid19:
......
......@@ -2,7 +2,7 @@ version: "3.3"
services:
covid-stats-x86:
image: comworkio/covid-stats:1.3
image: comworkio/covid-stats:1.4
environment:
- ELASTIC_URL=http://es01:9200
- ELASTIC_AUTHENTICATION=disabled
......
......@@ -96,7 +96,12 @@ invoke_url() {
usecase="${2}"
VERBOSE_OPT=""
[[ $DEBUG_MODE == "enabled" ]] && VERBOSE_OPT="-v"
[[ $CONTAINER_MODE == "enabled" ]] && curl -L "${url}" "${VERBOSE_OPT}" || curl -L "${url}" "${VERBOSE_OPT}" 2>>$(get_log_file_name "${usecase}")
if [[ $CONTAINER_MODE == "enabled" ]]; then
curl -L "${url}" ${VERBOSE_OPT}
else
curl -L "${url}" ${VERBOSE_OPT} 2>>$(get_log_file_name "${usecase}")
fi
}
push_document() {
......@@ -118,9 +123,9 @@ push_document() {
if [[ $(echo "${json}"|jq -r '.vdate') != "null" ]]; then
if [[ $CONTAINER_MODE == "enabled" ]]; then
curl "${indice_url}" "${VERBOSE_OPT}" ${AUTH_OPT} -X PUT -d "${json}" -H "${content_type}"
curl "${indice_url}" ${VERBOSE_OPT} ${AUTH_OPT} -X PUT -d "${json}" -H "${content_type}"
else
curl "${indice_url}" "${VERBOSE_OPT}" ${AUTH_OPT} -X PUT -d "${json}" -H "${content_type}" >> "${log_file}" 2>>"${log_file}"
curl "${indice_url}" ${VERBOSE_OPT} ${AUTH_OPT} -X PUT -d "${json}" -H "${content_type}" >> "${log_file}" 2>>"${log_file}"
fi
fi
}
......@@ -260,6 +265,11 @@ ingest_daemon() {
exit 1
fi
if [[ $STARTUP_WAIT_TIME -gt 0 ]]; then
echo "Wait for elasticsearch with STARTUP_WAIT_TIME=${STARTUP_WAIT_TIME}"
sleep "${STARTUP_WAIT_TIME}"
fi
if [[ $DAEMON_MODE == "enabled" ]]; then
echo "Running ${usecase} as a deamon with WAIT_TIME=${WAIT_TIME}"
while true; do
......@@ -274,11 +284,6 @@ ingest_daemon() {
[[ $# -lt 1 ]] && error
if [[ $STARTUP_WAIT_TIME -gt 0 ]]; then
echo "Wait for elasticsearch with STARTUP_WAIT_TIME=${STARTUP_WAIT_TIME}"
sleep "${STARTUP_WAIT_TIME}"
fi
options=$(getopt -o a,h,s,d -l help,debug,daemon-mode,container-mode,disable-auth,all,ingest-data,ingest-data-fr-hospital,ingest-data-fr-hospital-new,ingest-data-fr-hospital-age,ingest-data-fr-hospital-ets,ingest-data-fr-vaccine,ingest-data-world-vaccine-locations,ingest-data-world-vaccinations -- "$@")
set -- $options
while true; do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment