Upgrade Hauler to v1.2.1 and add version to build (#92)
All checks were successful
Synchronize Project Config / Update prjconf in OBS (push) Successful in -9s
Synchronize Project Metadata / sync-prj-meta (push) Successful in 1s
Trigger Devel Packages / Trigger source services for devel packages that changed (push) Successful in 1m6s

Reviewed-on: #92
Reviewed-by: Steven Hardy <steven.hardy@noreply.src.opensuse.org>
Reviewed-by: Denislav Prodanov <dprodanov@noreply.src.opensuse.org>
Co-authored-by: dbw7 <danial.bekhit@suse.com>
Co-committed-by: dbw7 <danial.bekhit@suse.com>
This commit is contained in:
Danial Bekhit 2025-03-20 20:28:44 +01:00 committed by Danial Bekhit
parent a3fda4c5c0
commit 2b194211ee
5 changed files with 22 additions and 80 deletions

View File

@ -69,7 +69,6 @@ BuildFlags: onlybuild:release-manifest-image
BuildFlags: onlybuild:baremetal-operator
BuildFlags: onlybuild:baremetal-operator-image
BuildFlags: onlybuild:ca-certificates-suse
BuildFlags: onlybuild:cosign
BuildFlags: onlybuild:crudini
BuildFlags: onlybuild:edge-image-builder
BuildFlags: onlybuild:edge-image-builder-image

View File

@ -1,18 +0,0 @@
<services>
<service name="obs_scm">
<param name="url">https://github.com/rancher-government-carbide/cosign.git</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="scm">git</param>
<param name="exclude">.get</param>
<param name="revision">v2.2.3+carbide.2</param>
<param name="versionrewrite-pattern">v(.*)</param>
<param name="changesgenerate">enable</param>
</service>
<service mode="buildtime" name="tar">
<param name="obsinfo">cosign.obsinfo</param>
</service>
<service mode="buildtime" name="set_version" />
<service name="go_modules">
<param name="compression">gz</param>
</service>
</services>

View File

@ -1,55 +0,0 @@
#
# spec file for package cosign-rgs
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define project https://github.com/hauler-dev/cosign
%define revision 49542360ffb5de63f9d2f5856b658651d5538e40
Name: cosign
Version: 0
Release: 0
Summary: Container Signing, Verification and Storage in an OCI registry
License: Apache-2.0
URL: https://github.com/rancher-government-carbide/cosign
Source: cosign-%{version}.tar
Source1: vendor.tar.gz
BuildRequires: golang-packaging
%description
%prep
%setup -q -a1 -n cosign-%{version}
%build
%goprep %{project}
DATE_FMT="+%%Y-%%m-%%dT%%H:%%M:%%SZ"
BUILD_DATE=$(date -u -d "@${SOURCE_DATE_EPOCH}" "${DATE_FMT}" 2>/dev/null || date -u -r "${SOURCE_DATE_EPOCH}" "${DATE_FMT}" 2>/dev/null || date -u "${DATE_FMT}")
CLI_PKG=sigs.k8s.io/release-utils/version
CLI_LDFLAGS="-X ${CLI_PKG}.gitVersion=%{version} -X ${CLI_PKG}.gitCommit=%{revision} -X ${CLI_PKG}.gitTreeState=release -X ${CLI_PKG}.buildDate=${BUILD_DATE}"
CGO_ENABLED=0 go build -mod=vendor -buildmode=pie -trimpath -ldflags "${CLI_LDFLAGS}" -o cosign ./cmd/cosign
%install
install -D -m 0755 cosign %{buildroot}%{_bindir}/cosign
%files
%license LICENSE
%doc *.md
%{_bindir}/cosign
%changelog

View File

@ -4,7 +4,7 @@
<param name="versionformat">@PARENT_TAG@</param>
<param name="scm">git</param>
<param name="exclude">.get</param>
<param name="revision">v1.0.7</param>
<param name="revision">v1.2.1</param>
<param name="versionrewrite-pattern">v(.*)</param>
<param name="changesgenerate">enable</param>
</service>
@ -15,4 +15,13 @@
<service name="go_modules">
<param name="compression">gz</param>
</service>
<service mode="buildtime" name="replace_using_env">
<param name="file">hauler.spec</param>
<param name="var">SOURCE_COMMIT</param>
<param name="eval">
SOURCE_COMMIT=$(grep commit hauler.obsinfo | cut -d" " -f2)
</param>
<param name="verbose">1</param>
</service>
<service mode="buildtime" name="set_version" />
</services>

View File

@ -18,7 +18,7 @@
%define project github.com/hauler-dev/hauler
Name: hauler
Version: 1.0.7
Version: 1.2.1
Release: 0
Summary: Airgap Swiss Army Knife
License: Apache-2.0
@ -26,7 +26,6 @@ URL: https://github.com/hauler-dev/hauler
Source: hauler-%{version}.tar
Source1: vendor.tar.gz
BuildRequires: golang-packaging
BuildRequires: cosign
%description
@ -38,10 +37,18 @@ BuildRequires: cosign
tar -xf %{SOURCE1}
mkdir cmd/hauler/binaries
cp `which cosign` cmd/hauler/binaries/cosign-linux-%{go_arch}
MODULE=hauler.dev/go/hauler
%define buildtime %(date +%%Y-%%m-%%dT%%H:%%M:%%S%%z)
%define buildcommit %%SOURCE_COMMIT%%
go build -mod=vendor -buildmode=pie -o hauler ./cmd/hauler
go build \
-mod=vendor \
-buildmode=pie \
-o hauler \
-ldflags \
"-X $MODULE/internal/version.gitVersion=v%{version} -X $MODULE/internal/version.gitCommit=%{buildcommit} -X $MODULE/internal/version.buildDate=%{buildtime}" \
./cmd/hauler
%install