From 678f7d42298b552a2c344bbb631a2c1780e56be4 Mon Sep 17 00:00:00 2001 From: Dimitris Karakasilis Date: Tue, 18 Jul 2023 10:30:41 +0300 Subject: [PATCH] Add provider-kairos package as part of this: https://github.com/kairos-io/kairos/issues/1609 Signed-off-by: Dimitris Karakasilis --- packages/system/provider-kairos/build.yaml | 38 +++++++++++++++++++ .../system/provider-kairos/collection.yaml | 35 +++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 packages/system/provider-kairos/build.yaml create mode 100644 packages/system/provider-kairos/collection.yaml diff --git a/packages/system/provider-kairos/build.yaml b/packages/system/provider-kairos/build.yaml new file mode 100644 index 000000000..064d751b9 --- /dev/null +++ b/packages/system/provider-kairos/build.yaml @@ -0,0 +1,38 @@ +{{if or (eq .Values.category "fips") (eq .Values.category "fips-static")}} +requires: + - name: "toolchain-go-ubuntu" + category: "fips" + version: ">=0" +{{else}} +requires: + - name: "toolchain-go-ubuntu" + category: "development" + version: ">=0" +{{end}} +prelude: +{{if or (eq .Values.category "fips") (eq .Values.category "fips-static")}} + - apt-get update && apt-get install gcc +{{end}} + - mkdir go/src/github.com/${GITHUB_ORG}/ -p + - cd go/src/github.com/${GITHUB_ORG}/ && git clone https://github.com/${GITHUB_ORG}/{{ .Values.name }}.git +env: + - GOPATH=/luetbuild/go/ + - GITHUB_ORG={{ ( index .Values.labels "github.owner" ) }} +{{if or (eq .Values.category "fips") (eq .Values.category "fips-static")}} + - CGO_ENABLED=1 + - GOEXPERIMENT=boringcrypto + - LDFLAGS="-w -X github.com/kairos-io/provider-kairos/v2/internal/cli.VERSION=v${PACKAGE_VERSION} {{with .Values.ldflags}}{{.}}{{end}}" +{{else}} + - CGO_ENABLED=0 + - LDFLAGS="-s -w -X github.com/kairos-io/provider-kairos/v2/internal/cli.VERSION=v${PACKAGE_VERSION} {{with .Values.ldflags}}{{.}}{{end}}" +{{end}} +steps: + - | + PACKAGE_VERSION=${PACKAGE_VERSION%\+*} && \ + cd go/src/github.com/${GITHUB_ORG}/{{ .Values.name }}/ && git checkout v"${PACKAGE_VERSION}" -b build && go build -o {{ .Values.name }} -ldflags="${LDFLAGS}" && mv {{.Values.name}} /usr/bin/ + - chmod +x /usr/bin/{{.Values.name}} +{{if or (eq .Values.category "fips") (eq .Values.category "fips-static")}} + - /usr/bin/{{.Values.name}} version 2>&1 >/dev/null | grep -i boringcrypto +{{end}} +includes: + - /usr/bin/{{.Values.name}} diff --git a/packages/system/provider-kairos/collection.yaml b/packages/system/provider-kairos/collection.yaml new file mode 100644 index 000000000..8dfb6cb2a --- /dev/null +++ b/packages/system/provider-kairos/collection.yaml @@ -0,0 +1,35 @@ +packages: + - name: "provider-kairos" + category: "system" + version: "2.3.0" + labels: + github.repo: "provider-kairos" + autobump.revdeps: "true" + github.owner: "kairos-io" + uri: + - https://github.com/kairos-io/provider-kairos + license: "Apache License v2" + description: "The Kairos standard provider" + - name: "provider-kairos" + category: "fips" + version: "2.3.0" + labels: + github.repo: "provider-kairos" + autobump.revdeps: "true" + github.owner: "kairos-io" + uri: + - https://github.com/kairos-io/provider-kairos + license: "Apache License v2" + description: "The Kairos standard provider" + - name: "provider-kairos" + category: "fips-static" + ldflags: "-linkmode external -extldflags -static" + version: "0.1.2" + labels: + github.repo: "provider-kairos" + autobump.revdeps: "true" + github.owner: "kairos-io" + uri: + - https://github.com/kairos-io/provider-kairos + license: "Apache License v2" + description: "The Kairos standard provider"