Skip to content
Snippets Groups Projects
Commit 1b392db6 authored by jurgenhaas's avatar jurgenhaas
Browse files

#1 Add test for DB tables and use PULL_DB as variable name...

#1 Add test for DB tables and use PULL_DB as variable name and commit message indicator to force the update
parent a68e1717
No related branches found
No related tags found
No related merge requests found
......@@ -60,17 +60,19 @@ variables:
script: |
if [[ "$CI_COMMIT_REF_NAME" == "master" ]]; then
DBREQUIRED="yes"
elif [[ "$CI_COMMIT_REF_NAME" == *"[re-build-db]"* ]]; then
elif [[ "$CI_COMMIT_REF_NAME" == *"[PULL_DB]"* ]]; then
DBREQUIRED="yes"
elif [[ "$FORCE_DB_UPDATE" == "yes" ]]; then
elif [[ "$PULL_DB" == "yes" ]]; then
DBREQUIRED="yes"
else
ID=$(docker container ls --all -q -f name=^${COMPOSE_PROJECT_NAME}_mariadb_1$)
if [[ ! -n ${ID} ]]; then
DBREQUIRED="yes"
else
# TODO: check if DB in container is empty.
echo "DB check not yet implemented"
TABLES=$(docker exec ${COMPOSE_PROJECT_NAME}_mariadb_1 mysql -u drupal --password=drupal -e "show tables;" drupal 2>/dev/null|grep users)
if [[ ! -n ${ID} ]]; then
DBREQUIRED="yes"
fi
fi
fi
except:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment