Skip to content

Commit

Permalink
rpmbuild: properly set root dir and enable tracing (#1272)
Browse files Browse the repository at this point in the history
As git_checkout() is not popping from the checkout dir we were setting
the root directory inside the package's source code (not the expected),
for that then we set the variable before the first git_checkout() call.

Additionally we are setting -e and -x flags so the it fails early and
also prints the script tracing.
  • Loading branch information
dorileo authored Oct 21, 2024
1 parent 236d025 commit 7ea78d0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packagebuild/daisy_startupscript_rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
# repository to clone. The script produces an RPM defined by an RPM spec in the
# packaging/ directory from the cloned repo.

set -ex

URL="http://metadata/computeMetadata/v1/instance/attributes"
function get_md() {
curl -f -H Metadata-Flavor:Google "${URL}/${1}"
Expand Down Expand Up @@ -76,8 +78,8 @@ fi

try_command yum install -y $GIT rpmdevtools yum-utils python3-devel

git_checkout "$REPO_OWNER" "$REPO_NAME" "$GIT_REF"
ROOT_WORK_DIR=$(pwd)
git_checkout "$REPO_OWNER" "$REPO_NAME" "$GIT_REF"

if [[ -n "$BUILD_DIR" ]]; then
cd "$BUILD_DIR"
Expand Down

0 comments on commit 7ea78d0

Please sign in to comment.