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

Issue #3518751 by jonathan1055, fjgarlin: Move calculation of gitlab templates...

Issue #3518751 by jonathan1055, fjgarlin: Move calculation of gitlab templates version out of *show-ci-variables
parent 8a296393
Branches
Tags
1 merge request!349#3518751 Move extract-version.php to separate ref
Pipeline #492036 failed
......@@ -79,11 +79,17 @@
export DRUPAL_PROJECT_FOLDER=$CI_PROJECT_DIR/$_WEB_ROOT/$DRUPAL_PROJECTS_PATH/$CI_PROJECT_NAME
echo "DRUPAL_PROJECT_FOLDER=$DRUPAL_PROJECT_FOLDER" >> build.env
# Determine the Gitlab Templates version and store for later use.
.templates-version: &templates-version
- |
echo "Executing curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/scripts/get-gitlab-templates-version.php"
curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/scripts/get-gitlab-templates-version.php
export GITLAB_TEMPLATES_VERSION=$(php get-gitlab-templates-version.php $_CURL_TEMPLATES_REF) && rm get-gitlab-templates-version.php
echo "GITLAB_TEMPLATES_VERSION=$GITLAB_TEMPLATES_VERSION" >> build.env
# Display the Gitlab Templates version, the Composer version and some useful CI variables.
.show-ci-variables: &show-ci-variables
- echo "Executing curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/scripts/extract-version.php"
- curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/scripts/extract-version.php
- php extract-version.php $_CURL_TEMPLATES_REF && rm extract-version.php
- echo "Gitlab Templates version $GITLAB_TEMPLATES_VERSION"
- composer --version
- |
printf "CI_PIPELINE_SOURCE = %s\n" $CI_PIPELINE_SOURCE &&
......@@ -298,6 +304,7 @@ stages:
- cd $CI_PROJECT_DIR && pwd
- *create-environment-variables
- *calculate-gitlab-ref
- *templates-version
- *show-ci-variables
- *show-environment-variables
- printf "$DIVIDER\n* If you have defined _TARGET_PHP or _TARGET_DB_VERSION on your project, please rename them to be _TARGET_D7_PHP or _TARGET_D7_DB_VERSION.$DIVIDER\n"
......
......@@ -108,11 +108,17 @@
export DRUPAL_PROJECT_FOLDER=$CI_PROJECT_DIR/$_WEB_ROOT/$DRUPAL_PROJECTS_PATH/$CI_PROJECT_NAME
echo "DRUPAL_PROJECT_FOLDER=$DRUPAL_PROJECT_FOLDER" >> build.env
# Determine the Gitlab Templates version and store for later use.
.templates-version: &templates-version
- |
echo "Executing curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/scripts/get-gitlab-templates-version.php"
curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/scripts/get-gitlab-templates-version.php
export GITLAB_TEMPLATES_VERSION=$(php get-gitlab-templates-version.php $_CURL_TEMPLATES_REF) && rm get-gitlab-templates-version.php
echo "GITLAB_TEMPLATES_VERSION=$GITLAB_TEMPLATES_VERSION" >> build.env
# Display the Gitlab Templates version, the Composer version and some useful CI variables.
.show-ci-variables: &show-ci-variables
- echo "Executing curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/scripts/extract-version.php"
- curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/scripts/extract-version.php
- php extract-version.php $_CURL_TEMPLATES_REF && rm extract-version.php
- echo "Gitlab Templates version $GITLAB_TEMPLATES_VERSION"
- composer --version
- |
printf "CI_PIPELINE_SOURCE = %s\n" $CI_PIPELINE_SOURCE &&
......@@ -431,6 +437,7 @@ stages:
- cd $CI_PROJECT_DIR && pwd
- *create-environment-variables
- *calculate-gitlab-ref
- *templates-version
- *show-ci-variables
- *show-environment-variables
- *add-composer-drupal-lenient
......
......@@ -67,5 +67,6 @@ if (isset($tags[$current_ref])) {
$version = $found_tag ? $found_tag : "$current_ref (branch)";
echo "GitLab Templates version: $version\n";
// This output is stored in the GITLAB_TEMPLATES_VERSION environment variable.
echo $version;
exit;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment