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:
reports:
dotenv: build.env
script:
- cd $CI_PROJECT_DIR && pwd
- *create-environment-variables
- *calculate-gitlab-ref
- *show-ci-variables
......@@ -396,6 +397,7 @@ phpcs:
allow_failure: false
- when: on_success
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
- vendor/bin/phpcs --version
- composer show | awk '$0 ~ /codesniffer|coder|coding-standard|variable-analysis/ {print $1 " " $2}';
......@@ -435,6 +437,7 @@ phpcs:
- <<: *with-database
- <<: *with-chrome
script:
- cd $CI_PROJECT_DIR && pwd
- *show-environment-variables
- *setup-webserver
- *simpletest-db
......@@ -488,6 +491,7 @@ test-only changes:
# Remove parallel definition, in case it was defined in a customized phpunit.
parallel:
script:
- cd $CI_PROJECT_DIR && pwd
- *show-environment-variables
- *setup-webserver
- *simpletest-db
......
......@@ -442,6 +442,7 @@ stages:
reports:
dotenv: build.env
script:
- cd $CI_PROJECT_DIR && pwd
- *create-environment-variables
- *calculate-gitlab-ref
- *show-ci-variables
......@@ -549,6 +550,7 @@ pages:
stage: build
image: python:3.12
script:
- cd $CI_PROJECT_DIR && pwd
- pip install mkdocs-material
- pwd && ls -l logo* && ls -l docs/logo* || true
- |
......@@ -585,7 +587,7 @@ composer-lint:
needs:
- composer
script:
- pwd
- cd $CI_PROJECT_DIR && pwd
- composer --version
# Validate the generated composer.json for the CI project.
- echo "Validating the composer.json file generated to build the environment."
......@@ -627,6 +629,7 @@ phpcs:
needs:
- composer
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
- vendor/bin/phpcs --version
- composer show | awk '$0 ~ /codesniffer|coder|coding-standard|variable-analysis/ {print $1 " " $2}';
......@@ -664,9 +667,9 @@ phpcs:
needs:
- composer
script:
- *check-composer-end-code
# Run from within project directory so paths are correct.
- 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 [ ! -f phpstan.neon ]; then
......@@ -762,10 +765,12 @@ upgrade status:
needs:
- composer
script:
- !reference [.show-environment-variables]
- !reference [.setup-webserver]
- !reference [.simpletest-db]
- !reference [.show-context]
- cd $CI_PROJECT_DIR && pwd
- *check-composer-end-code
- *show-environment-variables
- *setup-webserver
- *simpletest-db
- *show-context
- composer require drush/drush drupal/upgrade_status $_UPGRADE_STATUS_COMPOSER_EXTRA
- php $_WEB_ROOT/core/scripts/drupal install standard
- vendor/bin/drush --root=$_WEB_ROOT st
......@@ -812,9 +817,9 @@ stylelint:
needs:
- composer
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.
- 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)"
# If there is no .stylelintignore file, there is no warning or error. The
# option is just ignored.
......@@ -849,7 +854,7 @@ eslint:
- composer
script:
# 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.
# 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
......@@ -927,6 +932,7 @@ cspell:
- _cspell_updated_project_words.txt
- _cspell_json.txt
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"
- 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.
......@@ -1005,13 +1011,13 @@ cspell:
DRUPAL_NIGHTWATCH_IGNORE_DIRECTORIES: node_modules,vendor,.*,sites/*/files,sites/*/private,sites/simpletest
DRUPAL_NIGHTWATCH_OUTPUT: reports/nightwatch
script:
- cd $CI_PROJECT_DIR/$_WEB_ROOT && pwd
- *check-composer-end-code
- *setup-webserver
- *simpletest-db
- export DRUPAL_TEST_DB_URL=$SIMPLETEST_DB
- *show-environment-variables
- *show-context
- cd $_WEB_ROOT
# @see https://git.drupalcode.org/project/drupal/-/commit/dfa16b8aca8e92be1f00a021c520a645f11f0227
- cp ./core/.env.example ./core/.env
# dotenv-safe/config does not support environment variables.
......@@ -1133,6 +1139,7 @@ nightwatch (next major):
variables:
SYMFONY_DEPRECATIONS_HELPER: 'disabled'
script:
- cd $CI_PROJECT_DIR && pwd
- *check-composer-end-code
- *show-environment-variables
- *setup-webserver
......@@ -1273,6 +1280,8 @@ test-only changes:
interruptible: true
allow_failure: true
script:
- cd $$CI_PROJECT_DIR && pwd
- *check-composer-end-code
- *show-environment-variables
- *setup-webserver
- *simpletest-db
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment