From 27ebfdd844d361bd204c53d7546a95d5cc0e0d21 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 25 Jul 2021 21:42:39 -0400 Subject: [PATCH] CI (Buildkite): include the short commit hash in the artifact filename (#41700) (cherry picked from commit 343c2b19bc83dfa58cbb701babba4a0721e18903) --- .../pipelines/main/platforms/linux64.yml | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.buildkite/pipelines/main/platforms/linux64.yml b/.buildkite/pipelines/main/platforms/linux64.yml index 7780c574951e8..1e88db1144b4c 100644 --- a/.buildkite/pipelines/main/platforms/linux64.yml +++ b/.buildkite/pipelines/main/platforms/linux64.yml @@ -19,6 +19,17 @@ steps: # Include `/cache/repos` so that our `git` version introspection works. - "/cache/repos:/cache/repos" commands: | + echo "--- Print the short and long commit hashes" + SHORT_COMMIT_LENGTH=10 + SHORT_COMMIT=`echo $$BUILDKITE_COMMIT | cut -c1-$$SHORT_COMMIT_LENGTH` + JULIA_DIRECTORY_NAME="julia-$$SHORT_COMMIT" + JULIA_BINARYDIST_FILENAME=`make print-JULIA_BINARYDIST_FILENAME | cut -c27-` + ARTIFACT_FILE_EXTENSION="tar.gz" + ARTIFACT_FILENAME="$$JULIA_BINARYDIST_FILENAME.$$ARTIFACT_FILE_EXTENSION" + echo "The full commit is $$BUILDKITE_COMMIT" + echo "The Julia directory name will be $$JULIA_DIRECTORY_NAME" + echo "The artifact filename will be $$ARTIFACT_FILENAME" + echo "--- Build Julia from source" make -j 6 make release @@ -28,12 +39,13 @@ steps: ./julia -e 'using InteractiveUtils; InteractiveUtils.versioninfo()' echo "--- Compress build artifacts" - mv julia-* julia-artifact - rm -rf julia-linux64.tar.gz - tar czf julia-linux64.tar.gz julia-artifact/ + ls -ld $$JULIA_DIRECTORY_NAME/ + rm -rf $$ARTIFACT_FILENAME + tar czf $$ARTIFACT_FILENAME $$JULIA_DIRECTORY_NAME/ + ls -l $$ARTIFACT_FILENAME echo "--- Upload build artifacts" - buildkite-agent artifact upload julia-linux64.tar.gz + buildkite-agent artifact upload $$ARTIFACT_FILENAME timeout_in_minutes: 60 notify: - github_commit_status: