Skip to content
Snippets Groups Projects
Commit 24835a04 authored by Jonathan Smith's avatar Jonathan Smith Committed by Fran Garcia-Linares
Browse files

Issue #3503966 by jonathan1055, fjgarlin: Make sure each script: starts in the intended directory

parent eb16ad13
No related branches found
No related tags found
1 merge request!327#3503966 Ensure that each script starts in expected directory
Pipeline #417685 failed
...@@ -309,6 +309,7 @@ stages: ...@@ -309,6 +309,7 @@ stages:
reports: reports:
dotenv: build.env dotenv: build.env
script: script:
- cd $CI_PROJECT_DIR && pwd
- *create-environment-variables - *create-environment-variables
- *calculate-gitlab-ref - *calculate-gitlab-ref
- *show-ci-variables - *show-ci-variables
...@@ -396,6 +397,7 @@ phpcs: ...@@ -396,6 +397,7 @@ phpcs:
allow_failure: false allow_failure: false
- when: on_success - when: on_success
script: script:
- cd $CI_PROJECT_DIR && pwd
- test -f phpcs.xml.dist || curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/assets/phpcs.xml.dist - test -f phpcs.xml.dist || curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/assets/phpcs.xml.dist
- vendor/bin/phpcs --version - vendor/bin/phpcs --version
- composer show | awk '$0 ~ /codesniffer|coder|coding-standard|variable-analysis/ {print $1 " " $2}'; - composer show | awk '$0 ~ /codesniffer|coder|coding-standard|variable-analysis/ {print $1 " " $2}';
...@@ -435,6 +437,7 @@ phpcs: ...@@ -435,6 +437,7 @@ phpcs:
- <<: *with-database - <<: *with-database
- <<: *with-chrome - <<: *with-chrome
script: script:
- cd $CI_PROJECT_DIR && pwd
- *show-environment-variables - *show-environment-variables
- *setup-webserver - *setup-webserver
- *simpletest-db - *simpletest-db
...@@ -488,6 +491,7 @@ test-only changes: ...@@ -488,6 +491,7 @@ test-only changes:
# Remove parallel definition, in case it was defined in a customized phpunit. # Remove parallel definition, in case it was defined in a customized phpunit.
parallel: parallel:
script: script:
- cd $CI_PROJECT_DIR && pwd
- *show-environment-variables - *show-environment-variables
- *setup-webserver - *setup-webserver
- *simpletest-db - *simpletest-db
......
...@@ -442,6 +442,7 @@ stages: ...@@ -442,6 +442,7 @@ stages:
reports: reports:
dotenv: build.env dotenv: build.env
script: script:
- cd $CI_PROJECT_DIR && pwd
- *create-environment-variables - *create-environment-variables
- *calculate-gitlab-ref - *calculate-gitlab-ref
- *show-ci-variables - *show-ci-variables
...@@ -549,6 +550,7 @@ pages: ...@@ -549,6 +550,7 @@ pages:
stage: build stage: build
image: python:3.12 image: python:3.12
script: script:
- cd $CI_PROJECT_DIR && pwd
- pip install mkdocs-material - pip install mkdocs-material
- pwd && ls -l logo* && ls -l docs/logo* || true - pwd && ls -l logo* && ls -l docs/logo* || true
- | - |
...@@ -585,7 +587,7 @@ composer-lint: ...@@ -585,7 +587,7 @@ composer-lint:
needs: needs:
- composer - composer
script: script:
- pwd - cd $CI_PROJECT_DIR && pwd
- composer --version - composer --version
# Validate the generated composer.json for the CI project. # Validate the generated composer.json for the CI project.
- echo "Validating the composer.json file generated to build the environment." - echo "Validating the composer.json file generated to build the environment."
...@@ -627,6 +629,7 @@ phpcs: ...@@ -627,6 +629,7 @@ phpcs:
needs: needs:
- composer - composer
script: script:
- cd $CI_PROJECT_DIR && pwd
- test -f phpcs.xml.dist || curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/assets/phpcs.xml.dist - test -f phpcs.xml.dist || curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/assets/phpcs.xml.dist
- vendor/bin/phpcs --version - vendor/bin/phpcs --version
- composer show | awk '$0 ~ /codesniffer|coder|coding-standard|variable-analysis/ {print $1 " " $2}'; - composer show | awk '$0 ~ /codesniffer|coder|coding-standard|variable-analysis/ {print $1 " " $2}';
...@@ -664,9 +667,9 @@ phpcs: ...@@ -664,9 +667,9 @@ phpcs:
needs: needs:
- composer - composer
script: script:
- *check-composer-end-code
# Run from within project directory so paths are correct. # Run from within project directory so paths are correct.
- cd $CI_PROJECT_DIR/$_WEB_ROOT/modules/custom/$CI_PROJECT_NAME && pwd - cd $CI_PROJECT_DIR/$_WEB_ROOT/modules/custom/$CI_PROJECT_NAME && pwd
- *check-composer-end-code
# If there is no PHPStan configuration neon file get the default from /assets/phpstan.neon # If there is no PHPStan configuration neon file get the default from /assets/phpstan.neon
- | - |
if [ ! -f phpstan.neon ]; then if [ ! -f phpstan.neon ]; then
...@@ -762,10 +765,12 @@ upgrade status: ...@@ -762,10 +765,12 @@ upgrade status:
needs: needs:
- composer - composer
script: script:
- !reference [.show-environment-variables] - cd $CI_PROJECT_DIR && pwd
- !reference [.setup-webserver] - *check-composer-end-code
- !reference [.simpletest-db] - *show-environment-variables
- !reference [.show-context] - *setup-webserver
- *simpletest-db
- *show-context
- composer require drush/drush drupal/upgrade_status $_UPGRADE_STATUS_COMPOSER_EXTRA - composer require drush/drush drupal/upgrade_status $_UPGRADE_STATUS_COMPOSER_EXTRA
- php $_WEB_ROOT/core/scripts/drupal install standard - php $_WEB_ROOT/core/scripts/drupal install standard
- vendor/bin/drush --root=$_WEB_ROOT st - vendor/bin/drush --root=$_WEB_ROOT st
...@@ -812,9 +817,9 @@ stylelint: ...@@ -812,9 +817,9 @@ stylelint:
needs: needs:
- composer - composer
script: script:
- cd $_WEB_ROOT/core && corepack enable && yarn add @gitlab-formatters/stylelint-formatter-gitlab - cd $CI_PROJECT_DIR/$_WEB_ROOT/core && corepack enable && yarn add @gitlab-formatters/stylelint-formatter-gitlab
# Change directory to the project root folder. # Change directory to the project root folder.
- cd $CI_PROJECT_DIR/$_WEB_ROOT/modules/custom/$CI_PROJECT_NAME - cd $CI_PROJECT_DIR/$_WEB_ROOT/modules/custom/$CI_PROJECT_NAME && pwd
- echo "Stylelint version $(${CI_PROJECT_DIR}/${_WEB_ROOT}/core/node_modules/.bin/stylelint --version)" - echo "Stylelint version $(${CI_PROJECT_DIR}/${_WEB_ROOT}/core/node_modules/.bin/stylelint --version)"
# If there is no .stylelintignore file, there is no warning or error. The # If there is no .stylelintignore file, there is no warning or error. The
# option is just ignored. # option is just ignored.
...@@ -849,7 +854,7 @@ eslint: ...@@ -849,7 +854,7 @@ eslint:
- composer - composer
script: script:
# Change directory to the project root folder # Change directory to the project root folder
- cd $CI_PROJECT_DIR/$_WEB_ROOT/modules/custom/$CI_PROJECT_NAME - cd $CI_PROJECT_DIR/$_WEB_ROOT/modules/custom/$CI_PROJECT_NAME && pwd
# Configure ESLint with core defaults. We use core/.eslintrc.passing.json which includes core/.eslintrc.json and .eslintrc.jquery.json. # Configure ESLint with core defaults. We use core/.eslintrc.passing.json which includes core/.eslintrc.json and .eslintrc.jquery.json.
# These links are created in the folder above modules/custom/$CI_PROJECT_NAME and will be used in addition to the project's own .eslintrc.json. # These links are created in the folder above modules/custom/$CI_PROJECT_NAME and will be used in addition to the project's own .eslintrc.json.
- ln -s $CI_PROJECT_DIR/$_WEB_ROOT/core/.eslintrc.passing.json $CI_PROJECT_DIR/$_WEB_ROOT/modules/custom/.eslintrc.json - ln -s $CI_PROJECT_DIR/$_WEB_ROOT/core/.eslintrc.passing.json $CI_PROJECT_DIR/$_WEB_ROOT/modules/custom/.eslintrc.json
...@@ -927,6 +932,7 @@ cspell: ...@@ -927,6 +932,7 @@ cspell:
- _cspell_updated_project_words.txt - _cspell_updated_project_words.txt
- _cspell_json.txt - _cspell_json.txt
script: script:
- cd $CI_PROJECT_DIR && pwd
- echo "Executing curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/scripts/prepare-cspell.php" - echo "Executing curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/scripts/prepare-cspell.php"
- curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/scripts/prepare-cspell.php - curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/scripts/prepare-cspell.php
# Restore composer.json back to an unchanged version. # Restore composer.json back to an unchanged version.
...@@ -1005,13 +1011,13 @@ cspell: ...@@ -1005,13 +1011,13 @@ cspell:
DRUPAL_NIGHTWATCH_IGNORE_DIRECTORIES: node_modules,vendor,.*,sites/*/files,sites/*/private,sites/simpletest DRUPAL_NIGHTWATCH_IGNORE_DIRECTORIES: node_modules,vendor,.*,sites/*/files,sites/*/private,sites/simpletest
DRUPAL_NIGHTWATCH_OUTPUT: reports/nightwatch DRUPAL_NIGHTWATCH_OUTPUT: reports/nightwatch
script: script:
- cd $CI_PROJECT_DIR/$_WEB_ROOT && pwd
- *check-composer-end-code - *check-composer-end-code
- *setup-webserver - *setup-webserver
- *simpletest-db - *simpletest-db
- export DRUPAL_TEST_DB_URL=$SIMPLETEST_DB - export DRUPAL_TEST_DB_URL=$SIMPLETEST_DB
- *show-environment-variables - *show-environment-variables
- *show-context - *show-context
- cd $_WEB_ROOT
# @see https://git.drupalcode.org/project/drupal/-/commit/dfa16b8aca8e92be1f00a021c520a645f11f0227 # @see https://git.drupalcode.org/project/drupal/-/commit/dfa16b8aca8e92be1f00a021c520a645f11f0227
- cp ./core/.env.example ./core/.env - cp ./core/.env.example ./core/.env
# dotenv-safe/config does not support environment variables. # dotenv-safe/config does not support environment variables.
...@@ -1133,6 +1139,7 @@ nightwatch (next major): ...@@ -1133,6 +1139,7 @@ nightwatch (next major):
variables: variables:
SYMFONY_DEPRECATIONS_HELPER: 'disabled' SYMFONY_DEPRECATIONS_HELPER: 'disabled'
script: script:
- cd $CI_PROJECT_DIR && pwd
- *check-composer-end-code - *check-composer-end-code
- *show-environment-variables - *show-environment-variables
- *setup-webserver - *setup-webserver
...@@ -1273,6 +1280,8 @@ test-only changes: ...@@ -1273,6 +1280,8 @@ test-only changes:
interruptible: true interruptible: true
allow_failure: true allow_failure: true
script: script:
- cd $$CI_PROJECT_DIR && pwd
- *check-composer-end-code
- *show-environment-variables - *show-environment-variables
- *setup-webserver - *setup-webserver
- *simpletest-db - *simpletest-db
......
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