Skip to content

Commit

Permalink
Merge pull request uyuni-project#122 from uyuni-project/spec-fix
Browse files Browse the repository at this point in the history
Fix the build tags in the spec file
  • Loading branch information
deneb-alpha authored Jan 15, 2024
2 parents 9a0b57e + 2b9c3fb commit 4248fa4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ jobs:
- name: Compute version
run: |
tag=$(git describe --tags --abbrev=0 | cut -f 3 -d '-')
offset=$(git rev-list --count ${tag})
tag=$(git describe --tags --abbrev=0)
version=$(git describe --tags --abbrev=0 | cut -f 3 -d '-')
offset=$(git rev-list --count ${tag}..)
echo "VERSION=$tag-$offset" >> "$GITHUB_ENV"
- name: Build
Expand Down
17 changes: 5 additions & 12 deletions uyuni-tools.spec
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
%global provider_prefix %{provider}.%{provider_tld}/%{org}/%{project}
%global productname Uyuni

%global image registry.opensuse.org/uyuni/server
%global chart oci://registry.opensuse.org/uyuni/server-helm
%global namespace registry.opensuse.org/uyuni

%if 0%{?suse_version} >= 1600 || 0%{?sle_version} >= 150400 || 0%{?rhel} >= 8 || 0%{?fedora} >= 37 || 0%{?debian} >= 12 || 0%{?ubuntu} >= 2004
%define adm_build 1
Expand Down Expand Up @@ -254,22 +253,16 @@ tar -zxf %{SOURCE1}
%build
export GOFLAGS=-mod=vendor
mkdir -p bin
ADM_PATH="%{provider_prefix}/%{name_adm}/shared/utils"
UTILS_PATH="%{provider_prefix}/shared/utils"

tag=%{!?_default_tag:latest}
%if "%{?_default_tag}" != ""
tag='%{_default_tag}'
%endif

image=%{image}
%if "%{?_default_image}" != ""
image='%{_default_image}'
%endif

chart=%{chart}
%if "%{?_default_chart}" != ""
chart='%{_default_chart}'
image=%{namespace}
%if "%{?_default_namespace}" != ""
namespace='%{_default_namespace}'
%endif

go_tags=""
Expand All @@ -286,7 +279,7 @@ go_path=
%endif
%endif

GOLD_FLAGS="-X ${ADM_PATH}.DefaultImage=${image} -X ${ADM_PATH}.DefaultTag=${tag} -X ${ADM_PATH}.DefaultChart=${chart}"
GOLD_FLAGS="-X ${UTILS_PATH}.DefaultNamespace=${namespace} -X ${UTILS_PATH}.DefaultTag=${tag}"
GOLD_FLAGS="${GOLD_FLAGS} -X ${UTILS_PATH}.Version=%{version}"

# Workaround for rpm on Fedora and EL clones not able to handle go's compressed debug symbols
Expand Down

0 comments on commit 4248fa4

Please sign in to comment.