Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions buildrpm/yq.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

%if 0%{?with_debug}
# https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12
%global _dwz_low_mem_die_limit 0
%else
%global debug_package %{nil}
%endif
%global package_name github.com/mikefarah/yq

%define name yq
%define version 4.47.2
%define release 1
%global golang_version 1.20.12
%global _buildhost build-ol%{?oraclelinux}-%{?_arch}.oracle.com

Name: %{name}
Version: %{version}
Release: %{release}%{?dist}
Summary: a lightweight and portable command-line YAML processor
License: MIT
Url: https://github.com/mikefarah/yq
Source: %{name}-%{version}.tar.bz2
Vendor: Oracle America
BuildRequires: golang >= %{golang_version}
BuildRequires: jq

%description
A lightweight and portable command-line YAML processor. The aim of the project is to be the jq or sed of yaml files.

%prep
%setup -n %{name}-%{version}

%build
export GOPATH=$(go env GOPATH)
GOPATH_SRC=$GOPATH/src/%{package_name}
%__mkdir_p $GOPATH_SRC
%__rm -r $GOPATH_SRC
%__ln_s $PWD $GOPATH_SRC

pushd $GOPATH_SRC
git_short_ver=`curl -sS https://api.github.com/repos/mikefarah/yq/git/refs/tags/v%{version} | jq -r '.object.sha' | colrm 8`
LDFLAGS="-X main.GitCommit=${git_short_ver} -X main.GitDescribe=%{version}"
go build -v -o %{name} --ldflags "${LDFLAGS}"
popd

%install
%__install -D -m 0755 %{name} %{buildroot}/usr/bin/%{name}

%files
%license LICENSE THIRD_PARTY_LICENSES.txt
%attr(755,root,root) /usr/bin/%{name}

%clean
rm -fr %{buildroot}
rm -fr %{_builddir}/%{name}-%{version}

%changelog
* Tue Oct 07 2025 Oracle Cloud Native Environment Authors <[email protected]> - 4.47.2-1
- Added Oracle specific build files
13 changes: 13 additions & 0 deletions olm/jenkins/ci/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@Library('olcne-pipeline') _
import com.oracle.olcne.pipeline.BranchPattern

String version = "4.47.2";

olcnePipeline(
branchPattern: new BranchPattern(master: "oracle/release/" + version, feature: "feature/.*"),
customStages: [container: [enabled: false]],
platforms: ['ol7', 'ol8', 'ol9'],
yumOL7Repos: ['ol7_optional_latest', 'ol7_addons', 'ol7_developer_golang116'],
yumOL8Repos:['ol8_appstream', 'ol8_codeready_builder'],
yumOL9Repos:['ol9_appstream', 'ol9_codeready_builder']
)