Skip to content
Snippets Groups Projects
Commit 00e4dddb authored by jurgenhaas's avatar jurgenhaas
Browse files

#2 Add support for "[INITIAL_INSTALL]" in the commit...

#2 Add support for "[INITIAL_INSTALL]" in the commit message to trigger the initial installation of a Drupal site without DB and without tests
parent 800fd33d
No related branches found
No related tags found
No related merge requests found
......@@ -93,6 +93,12 @@ stages:
else
echo "No pulling required."
fi
INITIALINSTALL="no"
if [[ "$CI_COMMIT_MESSAGE" == *"[INITIAL_INSTALL]"* ]]; then
INITIALINSTALL="yes"
fi
echo "INITIALINSTALL=${INITIALINSTALL}" >> validation.env
except:
variables:
- $CAE
......@@ -188,7 +194,9 @@ stages:
GIT_STRATEGY: none
script: |
if [[ "$DBREQUIRED" == "yes" ]]; then
ascr drupal-dump-db ${CI_PROJECT_PATH} ${PWD}/${CI_PROJECT_NAME}.sql master
if [[ "$INITIALINSTALL" == "no" ]]; then
ascr drupal-dump-db ${CI_PROJECT_PATH} ${PWD}/${CI_PROJECT_NAME}.sql master
fi
fi
cache: {}
dependencies:
......@@ -214,13 +222,15 @@ stages:
GIT_STRATEGY: none
script: |
if [[ "$DBREQUIRED" == "yes" ]]; then
docker cp ${CI_PROJECT_NAME}.sql ${COMPOSE_PROJECT_NAME}_php_1:/var/www/html
drush sql:drop --yes
drush sql:query --file=../${CI_PROJECT_NAME}.sql
drush cr
drush updatedb
drush config-import sync
drush cr
if [[ "$INITIALINSTALL" == "no" ]]; then
docker cp ${CI_PROJECT_NAME}.sql ${COMPOSE_PROJECT_NAME}_php_1:/var/www/html
drush sql:drop --yes
drush sql:query --file=../${CI_PROJECT_NAME}.sql
drush cr
drush updatedb
drush config-import sync
drush cr
fi
fi
except:
refs:
......@@ -242,10 +252,12 @@ stages:
GIT_STRATEGY: none
script: |
if [[ "$DBREQUIRED" == "no" ]]; then
drush cr
drush updatedb
drush config-import sync
drush cr
if [[ "$INITIALINSTALL" == "no" ]]; then
drush cr
drush updatedb
drush config-import sync
drush cr
fi
fi
except:
refs:
......@@ -289,10 +301,12 @@ stages:
- default
variables:
GIT_STRATEGY: none
script:
#- ahoy test phpcs -- -n --report=xml --report-file=phpcs.xml
#- docker cp ${COMPOSE_PROJECT_NAME}_php_1:/var/www/html/phpcs.xml ./phpcs.xml
- echo "Disabled because of Drupal Coder issues" > ./phpcs.xml
script: |
if [[ "$INITIALINSTALL" == "no" ]]; then
# ahoy test phpcs -- -n --report=xml --report-file=phpcs.xml
# docker cp ${COMPOSE_PROJECT_NAME}_php_1:/var/www/html/phpcs.xml ./phpcs.xml
echo "Disabled because of Drupal Coder issues" > ./phpcs.xml
fi
artifacts:
name: phpcs
when: always
......@@ -315,8 +329,10 @@ stages:
- default
variables:
GIT_STRATEGY: none
script:
- ahoy test phpunit -- --log-junit junit.xml --testdox-html testdox.html
script: |
if [[ "$INITIALINSTALL" == "no" ]]; then
ahoy test phpunit -- --log-junit junit.xml --testdox-html testdox.html
fi
after_script:
- docker cp ${COMPOSE_PROJECT_NAME}_php_1:/var/www/html/junit.xml ./junit.xml
- docker cp ${COMPOSE_PROJECT_NAME}_php_1:/var/www/html/testdox.html ./testdox.html
......@@ -345,11 +361,11 @@ stages:
- default
variables:
GIT_STRATEGY: none
script:
- ls tests -lisa
- ahoy behat update
- ls tests/behat/ -lisa
- ahoy behat test2xml
script: |
if [[ "$INITIALINSTALL" == "no" ]]; then
ahoy behat update
ahoy behat test2xml
fi
after_script:
- docker cp ${COMPOSE_PROJECT_NAME}_php_1:/var/www/html/tests/output/default.xml ./behat.xml
retry: 1
......@@ -376,8 +392,10 @@ stages:
- default
variables:
GIT_STRATEGY: none
script:
- backstop test
script: |
if [[ "$INITIALINSTALL" == "no" ]]; then
backstop test
fi
artifacts:
name: backstop
when: always
......@@ -404,8 +422,12 @@ stages:
GIT_STRATEGY: none
environment:
name: ${ENVIRONMENT_NAME}
script:
- ascr drupal-deploy $HOST_NAME $SITE_NAME --extra-vars="DRUPAL_ARTEFACT_SRC=${PWD}" ${CAE}
script: |
if [[ "$INITIALINSTALL" == "no" ]]; then
ascr drupal-deploy $HOST_NAME $SITE_NAME --extra-vars="DRUPAL_ARTEFACT_SRC=${PWD}" ${CAE}
else
ascr drupal-config $HOST_NAME $SITE_NAME --extra-vars="DRUPAL_ARTEFACT_SRC=${PWD}" ${CAE}
fi
cache: {}
dependencies:
- 'Build Theme'
......@@ -424,8 +446,12 @@ stages:
GIT_STRATEGY: none
environment:
name: ${ENVIRONMENT_NAME}
script:
- ascr drupal-deploy $HOST_NAME $SITE_NAME --extra-vars="DRUPAL_ARTEFACT_SRC=${PWD}" ${CAE}
script: |
if [[ "$INITIALINSTALL" == "no" ]]; then
ascr drupal-deploy $HOST_NAME $SITE_NAME --extra-vars="DRUPAL_ARTEFACT_SRC=${PWD}" ${CAE}
else
ascr drupal-config $HOST_NAME $SITE_NAME --extra-vars="DRUPAL_ARTEFACT_SRC=${PWD}" ${CAE}
fi
cache: {}
dependencies:
- 'Build Prod Site'
......
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