pantry/projects/openshift.com/package.yml
Andrew 30b24c303a
+openshift.com (#5507)
* new file:   projects/openshift.com/package.yml

* \n

* go.dev: ^1.16

* Update package.yml

* GO_REQUIRED_MIN_VERSION:=1.21

* SHELL

* cross-build-{{hw.platform}}-amd64 & cross-build-{{hw.platform}}-arm64

* ARCH

* Oh, I got it. First I have to declare this variable. I didn't know that

* let's try clang

* i don't know why it does this

* not this

* -buildmode=pie

---------

Co-authored-by: Jacob Heider <jacob@pkgx.dev>
2024-03-11 09:54:46 -04:00

50 lines
1.3 KiB
YAML

distributable:
url: https://mirror.openshift.com/pub/openshift-v{{version.major}}/clients/ocp/{{version}}/openshift-client-src.tar.gz
strip-components: 1
versions:
url: https://mirror.openshift.com/pub/openshift-v4/clients/ocp/
match: /\d+\.\d+\.\d+/
dependencies:
kerberos.org: ^1.21
build:
dependencies:
go.dev: ^1.21
linux:
gnu.org/gcc: '*' # aarch64 wants `ld.gold`
script:
# linux builds like to segfault without -buildmode=pie
- run: sed -i 's/GO_LD_EXTRAFLAGS :=/GO_LD_EXTRAFLAGS :=-buildmode=pie /' Makefile
if: linux
- make $ARGS
- install -D _output/bin/{{hw.platform}}_${ARCH}/oc {{prefix}}/bin/oc
env:
# Without declaring ARCH, cross-build-{{hw.platform}}-${ARCH} will execute like cross-build-{{hw.platform}}-
ARCH:
x86-64:
ARCH: amd64
aarch64:
ARCH: arm64
ARGS:
- cross-build-{{hw.platform}}-${ARCH}
- OS_GIT_VERSION={{version}}
linux:
ARGS:
# https://github.com/openshift/oc/issues/562
- SHELL=/bin/bash
provides:
- bin/oc
test:
script:
- touch ./kubeconfig
- oc version --client --output=json | grep {{version}}
- oc config set-context foo 2>&1 | grep 'created'
- oc config get-contexts -o name | grep 'foo'
- cat kubeconfig | grep 'foo'
env:
KUBECONFIG: $PWD/kubeconfig