File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,3 +96,12 @@ stages:
9696 if [ ! -d vendor ]; then
9797 composer install --ignore-platform-reqs --optimize-autoloader --no-ansi --no-interaction --no-progress --no-scripts --quiet;
9898 fi
99+
100+ # -----------------------------------------------------------------------------------------------------------------------
101+ # FEATURE NAME
102+ # -----------------------------------------------------------------------------------------------------------------------
103+ .normalize-feature-name :
104+ script :
105+ # branch names may contain slashes (e.g. feature/ABC-12), deployer-tools flattens them
106+ # to a hyphen for the actual instance path, mirror that here to build matching URLs
107+ - FEATURE_NAME=$(echo "$CI_COMMIT_REF_NAME" | tr '/' '-')
Original file line number Diff line number Diff line change @@ -14,12 +14,12 @@ cache:feature:warmup:
1414 rules :
1515 - if : $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "merge_request_event"
1616 when : never
17- - if : $CI_COMMIT_REF_NAME =~ /^(main|feature-.*|[A-Z]{2,}-\d+-.*)$/
17+ - if : $CI_COMMIT_REF_NAME =~ /^(main|feature-.*|[A-Z]{2,}-\d+-.*|[^\/]+\/.* )$/
1818 when : always
1919 - when : never
20- variables :
21- TYPO3_BASEURL : https://$DOMAIN_STAGE/$CI_COMMIT_REF_NAME/
2220 script :
2321 - !reference [.check-deployment-dependencies, script]
22+ - !reference [.normalize-feature-name, script]
23+ - TYPO3_BASEURL="https://$DOMAIN_STAGE/${FEATURE_NAME}/"
2424 - echo -e "\e[33mRunning cache warmup on $TYPO3_BASEURL\e[0m"
2525 - vendor/bin/dep cache:warmup stage --feature=$CI_COMMIT_REF_NAME -v
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ deploy:feature:cleanup:
88 rules :
99 - if : $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "merge_request_event"
1010 when : never
11- - if : $CI_COMMIT_REF_NAME =~ /^(feature-.*|[A-Z]{2,}-\d+-.*)$/
11+ - if : $CI_COMMIT_REF_NAME =~ /^(feature-.*|[A-Z]{2,}-\d+-.*|[^\/]+\/.* )$/
1212 when : manual
1313 variables :
1414 GIT_STRATEGY : none
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ deploy:feature:rollback:
1111 rules :
1212 - if : $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "merge_request_event"
1313 when : never
14- - if : $CI_COMMIT_REF_NAME =~ /^(main|feature-.*|[A-Z]{2,}-\d+-.*)$/
14+ - if : $CI_COMMIT_REF_NAME =~ /^(main|feature-.*|[A-Z]{2,}-\d+-.*|[^\/]+\/.* )$/
1515 when : manual
1616 - when : never
1717 variables :
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ deploy:feature:
1111 rules :
1212 - if : $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "merge_request_event"
1313 when : never
14- - if : $CI_COMMIT_REF_NAME =~ /^(main|feature-.*|[A-Z]{2,}-\d+-.*)$/
14+ - if : $CI_COMMIT_REF_NAME =~ /^(main|feature-.*|[A-Z]{2,}-\d+-.*|[^\/]+\/.* )$/
1515 when : always
1616 resource_group : $CI_COMMIT_REF_NAME
1717 variables :
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ sync:feature:
2222 rules :
2323 - if : $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "merge_request_event"
2424 when : never
25- - if : $CI_COMMIT_REF_NAME =~ /^(feature-.*|[A-Z]{2,}-\d+-.*)$/
25+ - if : $CI_COMMIT_REF_NAME =~ /^(feature-.*|[A-Z]{2,}-\d+-.*|[^\/]+\/.* )$/
2626 when : manual
2727 - if : $CI_COMMIT_REF_NAME == "main"
2828 when : manual
Original file line number Diff line number Diff line change @@ -12,11 +12,11 @@ test:feature:codeception:
1212 rules :
1313 - if : $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "merge_request_event"
1414 when : never
15- - if : $CI_COMMIT_REF_NAME =~ /^(main|feature-.*|[A-Z]{2,}-\d+-.*)$/
16- variables :
17- TYPO3_BASEURL : https://$DOMAIN_STAGE/$CI_COMMIT_REF_NAME/
15+ - if : $CI_COMMIT_REF_NAME =~ /^(main|feature-.*|[A-Z]{2,}-\d+-.*|[^\/]+\/.*)$/
1816 script :
1917 - !reference [.check-deployment-dependencies, script]
18+ - !reference [.normalize-feature-name, script]
19+ - TYPO3_BASEURL="https://$DOMAIN_STAGE/${FEATURE_NAME}/"
2020 - echo -e "\e[33mRunning Codeception tests on $TYPO3_BASEURL\e[0m"
2121 - vendor/bin/codecept run --html --steps
2222 artifacts :
Original file line number Diff line number Diff line change @@ -9,14 +9,15 @@ test:feature:http:
99 rules :
1010 - if : $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "merge_request_event"
1111 when : never
12- - if : $CI_COMMIT_REF_NAME =~ /^(main|feature-.*|[A-Z]{2,}-\d+-.*)$/
12+ - if : $CI_COMMIT_REF_NAME =~ /^(main|feature-.*|[A-Z]{2,}-\d+-.*|[^\/]+\/.* )$/
1313 variables :
1414 HTTP_TEST_DIR : tests/http
1515 HTTP_ENV_FILE : http-client.env.json
1616 HTTP_ENV : staging
1717 HTTP_BASE_PATH : _api
18- HTTP_BASE_URL : https://$DOMAIN_STAGE/$CI_COMMIT_REF_NAME/
1918 script :
19+ - !reference [.normalize-feature-name, script]
20+ - HTTP_BASE_URL="https://$DOMAIN_STAGE/${FEATURE_NAME}/"
2021 - echo -e "\e[33mRunning http tests on $HTTP_BASE_URL$HTTP_BASE_PATH\e[0m"
2122 - |
2223 for file in ${HTTP_TEST_DIR}/*.http; do
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ test:prod:http:
99 rules :
1010 - if : $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "merge_request_event"
1111 when : never
12- - if : $CI_COMMIT_REF_NAME =~ /^(main|feature-.*|[A-Z]{2,}-\d+-.*)$/
12+ - if : $CI_COMMIT_REF_NAME =~ /^(main|feature-.*|[A-Z]{2,}-\d+-.*|[^\/]+\/.* )$/
1313 variables :
1414 HTTP_TEST_DIR : tests/http
1515 HTTP_ENV_FILE : http-client.env.json
You can’t perform that action at this time.
0 commit comments