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: ...@@ -60,17 +60,19 @@ variables:
script: | script: |
if [[ "$CI_COMMIT_REF_NAME" == "master" ]]; then if [[ "$CI_COMMIT_REF_NAME" == "master" ]]; then
DBREQUIRED="yes" DBREQUIRED="yes"
elif [[ "$CI_COMMIT_REF_NAME" == *"[re-build-db]"* ]]; then elif [[ "$CI_COMMIT_REF_NAME" == *"[PULL_DB]"* ]]; then
DBREQUIRED="yes" DBREQUIRED="yes"
elif [[ "$FORCE_DB_UPDATE" == "yes" ]]; then elif [[ "$PULL_DB" == "yes" ]]; then
DBREQUIRED="yes" DBREQUIRED="yes"
else else
ID=$(docker container ls --all -q -f name=^${COMPOSE_PROJECT_NAME}_mariadb_1$) ID=$(docker container ls --all -q -f name=^${COMPOSE_PROJECT_NAME}_mariadb_1$)
if [[ ! -n ${ID} ]]; then if [[ ! -n ${ID} ]]; then
DBREQUIRED="yes" DBREQUIRED="yes"
else else
# TODO: check if DB in container is empty. TABLES=$(docker exec ${COMPOSE_PROJECT_NAME}_mariadb_1 mysql -u drupal --password=drupal -e "show tables;" drupal 2>/dev/null|grep users)
echo "DB check not yet implemented" if [[ ! -n ${ID} ]]; then
DBREQUIRED="yes"
fi
fi fi
fi fi
except: except:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment