]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-15355 custom clone script for docker packaging task
authorlukasz-jarocki-sonarsource <77498856+lukasz-jarocki-sonarsource@users.noreply.github.com>
Thu, 2 Sep 2021 07:40:19 +0000 (09:40 +0200)
committersonartech <sonartech@sonarsource.com>
Thu, 2 Sep 2021 20:03:20 +0000 (20:03 +0000)
.cirrus.yml

index 96acb0c01e8d3a2eb862affabc4f7cbe8d4189e8..6f14a28b07018057d1d705d19e4f8f96a741cddc 100644 (file)
@@ -94,6 +94,12 @@ node_modules_cache_template: &NODE_MODULES_CACHE_TEMPLATE
         private/core-extension-license/yarn.lock \
         private/core-extension-securityreport/yarn.lock
 
+custom_clone_script_template: &CUSTOM_CLONE_SCRIPT_TEMPLATE
+  clone_script: |
+    git clone --recursive --branch=$CIRRUS_BRANCH https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR --depth=1
+    git fetch origin $CIRRUS_CHANGE_IN_REPO --depth=1
+    git reset --hard $CIRRUS_CHANGE_IN_REPO
+
 build_task:
   <<: *NODE_MODULES_CACHE_TEMPLATE
   only_if: >-
@@ -433,8 +439,7 @@ package_docker_task:
     disk: 10
     cpu: 4
     memory: 8G
-  env:
-    CIRRUS_CLONE_DEPTH: '1'
+  <<: *CUSTOM_CLONE_SCRIPT_TEMPLATE
   install_tooling_script:
     - ./private/cirrus/cirrus-tooling-for-package-docker.sh
   package_script: