Skip to content

Commit

Permalink
Use hash from build
Browse files Browse the repository at this point in the history
  • Loading branch information
major committed Jan 26, 2024
1 parent cb1192c commit 324e4b5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions build_rpm.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
#!/bin/bash
set -euxo pipefail

FEDORA_RELEASE=39
SPEC=/src/golang-github-redhatcloudx-otel-builder.spec

# Set up packages.
echo "fastestmirror=1" >>/etc/dnf/dnf.conf
echo "max_parallel_downloads=20" >>/etc/dnf/dnf.conf
dnf -qy install git mock rpm-build rpmdevtools

FEDORA_RELEASE=39
SPEC=/src/*.spec
# Set the right commit SHA in the spec file.
pushd /src
CURRENT_COMMIT=$(git rev-parse HEAD)
sed -i "s/CURRENT_COMMIT_GOES_HERE/${CURRENT_COMMIT}/" $SPEC
popd

# Build the RPM.
rpmdev-spectool -R -g $SPEC
rpmbuild -bs $SPEC | tee /tmp/srpm-name.txt
SRPM_NAME=$(grep Wrote /tmp/srpm-name.txt | awk '{print $2}')
Expand Down
2 changes: 1 addition & 1 deletion golang-github-redhatcloudx-otel-builder.spec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# https://github.com/redhatcloudx/ocb-test
%global goipath github.com/redhatcloudx/otel-builder
%global commit main
%global commit CURRENT_COMMIT_GOES_HERE

%gometa -f

Expand Down

0 comments on commit 324e4b5

Please sign in to comment.