Skip to content
Snippets Groups Projects
Commit dad9fd17 authored by Pierre-Gilles Levallois's avatar Pierre-Gilles Levallois
Browse files

Add Init-Grid stage

parent 91f4f77b
No related branches found
No related tags found
1 merge request!6Fully functional version that calculate layer with all stages
Pipeline #55211 passed
......@@ -209,7 +209,23 @@ Build Calqul Git-lfs:
# tags:
# - ns-arb-d01
1. Init Datas:
1. Init Grid:
stage: Deploy Calqul Buttons
when: manual
environment: dev
variables:
NAMESPACE: "ns-$TRIGRAMME-$NAMESPACE_ENV"
CALQUL_ACTION: "init-grid"
before_script:
- *prepare_deployment
script:
- *apply_confs
rules:
- if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
tags:
- ns-arb-d01
2. Init Datas:
stage: Deploy Calqul Buttons
when: manual
environment: dev
......@@ -225,7 +241,7 @@ Build Calqul Git-lfs:
tags:
- ns-arb-d01
2. Compute Factors:
3. Compute Factors:
stage: Deploy Calqul Buttons
when: manual
environment: dev
......@@ -241,7 +257,7 @@ Build Calqul Git-lfs:
tags:
- ns-arb-d01
3. Compute Indices:
4. Compute Indices:
stage: Deploy Calqul Buttons
when: manual
environment: dev
......@@ -257,7 +273,7 @@ Build Calqul Git-lfs:
tags:
- ns-arb-d01
4. Dump Datas:
5. Dump Datas:
stage: Deploy Calqul Buttons
when: manual
environment: dev
......
......@@ -54,7 +54,7 @@ comment () {
# Usage
usage () {
comment "$0 [init-datas|compute-factors|compute-indices|dump-datas|all] $namespace_env $DB_HOST $DB_PORT $DB_NAME $DB_USER"
comment "$0 [init-grid|init-datas|compute-factors|compute-indices|dump-datas|all] $namespace_env $DB_HOST $DB_PORT $DB_NAME $DB_USER"
}
# Check the last command return code (must be insterted just after the commend )
......@@ -92,17 +92,17 @@ comment "command line is '$0 $action $namespace_env $DB_HOST $DB_PORT $DB_NAME $
comment "Postgres server says : "
nb_try=1
while [ $nb_try -lt 11 ]; do
is_pgready=$(pg_isready -d $DB_NAME -h $DB_HOST -p $DB_PORT -U $DB_USER)
if [ $is_pgready -ne 0 ]; then
is_pgready=$("pg_isready -d $DB_NAME -h $DB_HOST -p $DB_PORT -U $DB_USER")
if [ "x$is_pgready" != "x0" ]; then
comment "Try #$nb_try : PostGIS Database is not ready. Sleeping for 30s, before retry..."
sleep 30;
sleep 1;
((nb_try++))
else
break
fi
done
if [ $is_pgready -ne 0 ]; then
is_pgready=$(pg_isready -d $DB_NAME -h $DB_HOST -p $DB_PORT -U $DB_USER)
if [ "x$is_pgready" != "x0" ]; then
is_pgready=$("pg_isready -d $DB_NAME -h $DB_HOST -p $DB_PORT -U $DB_USER")
check
fi;
......@@ -111,7 +111,7 @@ python3 main.py displayEnv
comment "Checking action to do : "
case "$action" in
"init-datas"|"compute-factors"|"compute-indices"|"dump-datas"|"all" )
"init-grid"|"init-datas"|"compute-factors"|"compute-indices"|"dump-datas"|"all" )
comment "Action is '$action'."
check
;;
......@@ -122,6 +122,12 @@ case "$action" in
;;
esac
if [ $action == "init-grid" ] || [ $action == "all" ]; then
stage "init-grid"
python3 main.py initGrid $GRID_SIZE
check
fi
if [ $action == "init-datas" ] || [ $action == "all" ]; then
stage "init-datas"
python3 main.py initDatas
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment