From 3ab7f1c55dd2139ae2f434d4b9dc72aa0d9404d7 Mon Sep 17 00:00:00 2001 From: Milan Mertens Date: Tue, 6 Feb 2024 14:42:06 +0000 Subject: [PATCH] ci(phpstan) fix custamapp install --- ci/gitlab-ci/lib.yml | 9 ++++++++- ci/gitlab-ci/lib/scripts/test.sh | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ci/gitlab-ci/lib.yml b/ci/gitlab-ci/lib.yml index bac31ab6ca..7c51e3aa39 100644 --- a/ci/gitlab-ci/lib.yml +++ b/ci/gitlab-ci/lib.yml @@ -841,13 +841,20 @@ git submodule init git submodule update + # Install source customapp, if pipeline runs for a customapp if [ "${CI_IS_CUSTOMAPP}" == "true" ]; then + # COMPOSER custom cache + # CI_CUSTOM_CACHE_DIR is a volume shared betwean runners + export COMPOSER_CACHE_DIR=${CI_CUSTOM_CACHE_DIR}/${CI_PROJECT_NAMESPACE}/composer-cache/v1/ + mkdir -p ${COMPOSER_CACHE_DIR} + log "instaling custom app ..." customappname=$(cat ${CI_PROJECT_DIR}/composer.json | jq -r '.name') pushd ${TINE20ROOT}/tine20 + composer config "repositories.ci" git "${CI_REPOSITORY_URL}"; - composer require "$name dev-master#${CI_COMMIT_SHA}"; + composer require "$customappname dev-master#${CI_COMMIT_SHA}"; popd fi diff --git a/ci/gitlab-ci/lib/scripts/test.sh b/ci/gitlab-ci/lib/scripts/test.sh index 3a97cdf544..4095183273 100644 --- a/ci/gitlab-ci/lib/scripts/test.sh +++ b/ci/gitlab-ci/lib/scripts/test.sh @@ -27,13 +27,20 @@ test_prepare_working_dir() { git submodule init git submodule update + # Install source customapp, if pipeline runs for a customapp if [ "${CI_IS_CUSTOMAPP}" == "true" ]; then + # COMPOSER custom cache + # CI_CUSTOM_CACHE_DIR is a volume shared betwean runners + export COMPOSER_CACHE_DIR=${CI_CUSTOM_CACHE_DIR}/${CI_PROJECT_NAMESPACE}/composer-cache/v1/ + mkdir -p ${COMPOSER_CACHE_DIR} + log "instaling custom app ..." customappname=$(cat ${CI_PROJECT_DIR}/composer.json | jq -r '.name') pushd ${TINE20ROOT}/tine20 + composer config "repositories.ci" git "${CI_REPOSITORY_URL}"; - composer require "$name dev-master#${CI_COMMIT_SHA}"; + composer require "$customappname dev-master#${CI_COMMIT_SHA}"; popd fi