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
Branches develop
Tags
No related merge requests found
...@@ -93,6 +93,12 @@ stages: ...@@ -93,6 +93,12 @@ stages:
else else
echo "No pulling required." echo "No pulling required."
fi fi
INITIALINSTALL="no"
if [[ "$CI_COMMIT_MESSAGE" == *"[INITIAL_INSTALL]"* ]]; then
INITIALINSTALL="yes"
fi
echo "INITIALINSTALL=${INITIALINSTALL}" >> validation.env
except: except:
variables: variables:
- $CAE - $CAE
...@@ -188,7 +194,9 @@ stages: ...@@ -188,7 +194,9 @@ stages:
GIT_STRATEGY: none GIT_STRATEGY: none
script: | script: |
if [[ "$DBREQUIRED" == "yes" ]]; then 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 fi
cache: {} cache: {}
dependencies: dependencies:
...@@ -214,13 +222,15 @@ stages: ...@@ -214,13 +222,15 @@ stages:
GIT_STRATEGY: none GIT_STRATEGY: none
script: | script: |
if [[ "$DBREQUIRED" == "yes" ]]; then if [[ "$DBREQUIRED" == "yes" ]]; then
docker cp ${CI_PROJECT_NAME}.sql ${COMPOSE_PROJECT_NAME}_php_1:/var/www/html if [[ "$INITIALINSTALL" == "no" ]]; then
drush sql:drop --yes docker cp ${CI_PROJECT_NAME}.sql ${COMPOSE_PROJECT_NAME}_php_1:/var/www/html
drush sql:query --file=../${CI_PROJECT_NAME}.sql drush sql:drop --yes
drush cr drush sql:query --file=../${CI_PROJECT_NAME}.sql
drush updatedb drush cr
drush config-import sync drush updatedb
drush cr drush config-import sync
drush cr
fi
fi fi
except: except:
refs: refs:
...@@ -242,10 +252,12 @@ stages: ...@@ -242,10 +252,12 @@ stages:
GIT_STRATEGY: none GIT_STRATEGY: none
script: | script: |
if [[ "$DBREQUIRED" == "no" ]]; then if [[ "$DBREQUIRED" == "no" ]]; then
drush cr if [[ "$INITIALINSTALL" == "no" ]]; then
drush updatedb drush cr
drush config-import sync drush updatedb
drush cr drush config-import sync
drush cr
fi
fi fi
except: except:
refs: refs:
...@@ -289,10 +301,12 @@ stages: ...@@ -289,10 +301,12 @@ stages:
- default - default
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
script: script: |
#- ahoy test phpcs -- -n --report=xml --report-file=phpcs.xml if [[ "$INITIALINSTALL" == "no" ]]; then
#- docker cp ${COMPOSE_PROJECT_NAME}_php_1:/var/www/html/phpcs.xml ./phpcs.xml # ahoy test phpcs -- -n --report=xml --report-file=phpcs.xml
- echo "Disabled because of Drupal Coder issues" > ./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: artifacts:
name: phpcs name: phpcs
when: always when: always
...@@ -315,8 +329,10 @@ stages: ...@@ -315,8 +329,10 @@ stages:
- default - default
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
script: script: |
- ahoy test phpunit -- --log-junit junit.xml --testdox-html testdox.html if [[ "$INITIALINSTALL" == "no" ]]; then
ahoy test phpunit -- --log-junit junit.xml --testdox-html testdox.html
fi
after_script: 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/junit.xml ./junit.xml
- docker cp ${COMPOSE_PROJECT_NAME}_php_1:/var/www/html/testdox.html ./testdox.html - docker cp ${COMPOSE_PROJECT_NAME}_php_1:/var/www/html/testdox.html ./testdox.html
...@@ -345,11 +361,11 @@ stages: ...@@ -345,11 +361,11 @@ stages:
- default - default
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
script: script: |
- ls tests -lisa if [[ "$INITIALINSTALL" == "no" ]]; then
- ahoy behat update ahoy behat update
- ls tests/behat/ -lisa ahoy behat test2xml
- ahoy behat test2xml fi
after_script: after_script:
- docker cp ${COMPOSE_PROJECT_NAME}_php_1:/var/www/html/tests/output/default.xml ./behat.xml - docker cp ${COMPOSE_PROJECT_NAME}_php_1:/var/www/html/tests/output/default.xml ./behat.xml
retry: 1 retry: 1
...@@ -376,8 +392,10 @@ stages: ...@@ -376,8 +392,10 @@ stages:
- default - default
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
script: script: |
- backstop test if [[ "$INITIALINSTALL" == "no" ]]; then
backstop test
fi
artifacts: artifacts:
name: backstop name: backstop
when: always when: always
...@@ -404,8 +422,12 @@ stages: ...@@ -404,8 +422,12 @@ stages:
GIT_STRATEGY: none GIT_STRATEGY: none
environment: environment:
name: ${ENVIRONMENT_NAME} name: ${ENVIRONMENT_NAME}
script: script: |
- ascr drupal-deploy $HOST_NAME $SITE_NAME --extra-vars="DRUPAL_ARTEFACT_SRC=${PWD}" ${CAE} 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: {} cache: {}
dependencies: dependencies:
- 'Build Theme' - 'Build Theme'
...@@ -424,8 +446,12 @@ stages: ...@@ -424,8 +446,12 @@ stages:
GIT_STRATEGY: none GIT_STRATEGY: none
environment: environment:
name: ${ENVIRONMENT_NAME} name: ${ENVIRONMENT_NAME}
script: script: |
- ascr drupal-deploy $HOST_NAME $SITE_NAME --extra-vars="DRUPAL_ARTEFACT_SRC=${PWD}" ${CAE} 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: {} cache: {}
dependencies: dependencies:
- 'Build Prod Site' - 'Build Prod Site'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment