Skip to content

Commit

Permalink
fix(generate-build-artifact): Use project dirname as fallback project ID
Browse files Browse the repository at this point in the history
This allows sensible project ID to be used even when it is not provided by the environment.  We still allow setting the PROJECT_ID environment variable if customizing the behavior is still desired.

Signed-off-by: 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>
  • Loading branch information
brlin-tw committed Sep 30, 2024
1 parent bcea617 commit ed37d78
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion continuous-integration/generate-build-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ if ! script="$(
fi

script_dir="${script%/*}"
project_dir="${script_dir%/*}"
project_dirname="${project_dir##*/}"

if ! test -e "${script_dir}/venv"; then
printf \
Expand Down Expand Up @@ -84,7 +86,7 @@ project_version="${version_describe#v}"

printf \
'Info: Generating the project archive...\n'
project_id="${CI_PROJECT_NAME:-"${project_id}"}"
project_id="${CI_PROJECT_NAME:-"${PROJECT_ID:-"${project_dirname}"}"}"
release_id="${project_id}-${project_version}"
git_archive_all_opts=(
# Add an additional layer of folder for containing the archive
Expand Down

0 comments on commit ed37d78

Please sign in to comment.