From fe7905688e6a0f1969e00686b078f15d7d01e245 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Sun, 27 Nov 2022 14:33:42 +0000 Subject: [PATCH] Create osbuilder consumable bundles --- packages/bundles/osbuilder/k3s/build.yaml | 23 ++++++++++++++++ .../bundles/osbuilder/k3s/collection.yaml | 9 +++++++ packages/bundles/provider-c3os/build.yaml | 26 ------------------- .../bundles/provider-c3os/collection.yaml | 7 ----- packages/bundles/provider-kairos/build.yaml | 17 ++++++++++++ .../bundles/provider-kairos/collection.yaml | 4 +++ 6 files changed, 53 insertions(+), 33 deletions(-) create mode 100644 packages/bundles/osbuilder/k3s/build.yaml create mode 100644 packages/bundles/osbuilder/k3s/collection.yaml delete mode 100644 packages/bundles/provider-c3os/build.yaml delete mode 100644 packages/bundles/provider-c3os/collection.yaml create mode 100644 packages/bundles/provider-kairos/build.yaml create mode 100644 packages/bundles/provider-kairos/collection.yaml diff --git a/packages/bundles/osbuilder/k3s/build.yaml b/packages/bundles/osbuilder/k3s/build.yaml new file mode 100644 index 0000000..a6a7ea7 --- /dev/null +++ b/packages/bundles/osbuilder/k3s/build.yaml @@ -0,0 +1,23 @@ +{{ if eq .Values.init "systemd" }} +image: golang:1.18 +prelude: +- apt-get update +- apt-get install -y git curl systemd +{{ else }} +image: golang:1.18-alpine +prelude: +- apk add git curl openrc +{{ end }} +- curl -sfL https://get.k3s.io > installer.sh +steps: +- bash installer.sh +- bash installer.sh agent +- mkdir -p /etc/rancher/k3s/ && touch /etc/rancher/k3s/.keep + +exclude: +- etc/rancher/k3s/k3s.env +- etc/rancher/k3s/k3s-agent.env +env: +- INSTALL_K3S_VERSION={{.Values.version}} +- INSTALL_K3S_SKIP_START="true" +- INSTALL_K3S_SKIP_ENABLE="true" \ No newline at end of file diff --git a/packages/bundles/osbuilder/k3s/collection.yaml b/packages/bundles/osbuilder/k3s/collection.yaml new file mode 100644 index 0000000..8e76f5b --- /dev/null +++ b/packages/bundles/osbuilder/k3s/collection.yaml @@ -0,0 +1,9 @@ +packages: +- name: "k3s-systemd" + category: "osbuilder-bundles" + version: "v1.21.14+k3s1" + init: systemd +- name: "k3s-openrc" + category: "osbuilder-bundles" + version: "v1.21.14+k3s1" + init: openrc \ No newline at end of file diff --git a/packages/bundles/provider-c3os/build.yaml b/packages/bundles/provider-c3os/build.yaml deleted file mode 100644 index ec884e6..0000000 --- a/packages/bundles/provider-c3os/build.yaml +++ /dev/null @@ -1,26 +0,0 @@ -{{ if eq .Values.init "systemd" }} -image: golang:1.18 -prelude: -- apt-get update -- apt-get install -y git curl systemd -{{ else }} -image: golang:1.18-alpine -prelude: -- apk add git curl openrc -{{ end }} -- git clone https://github.com/c3os-io/provider-c3os -- cd provider-c3os && git checkout {{.Values.tag}} -- curl -sfL https://get.k3s.io > installer.sh -steps: -- cd provider-c3os && go build -o agent-provider-c3os ./ -- mv provider-c3os/agent-provider-c3os /usr/local/bin -- bash installer.sh -- bash installer.sh agent -{{ if ne .Values.init "systemd" }} -- rm -rf /etc/rancher/k3s/k3s.env /etc/rancher/k3s/k3s-agent.env && touch /etc/rancher/k3s/.keep -{{end}} - -env: -- INSTALL_K3S_VERSION={{.Values.k3s_version}} -- INSTALL_K3S_SKIP_START="true" -- INSTALL_K3S_SKIP_ENABLE="true" \ No newline at end of file diff --git a/packages/bundles/provider-c3os/collection.yaml b/packages/bundles/provider-c3os/collection.yaml deleted file mode 100644 index b859eb0..0000000 --- a/packages/bundles/provider-c3os/collection.yaml +++ /dev/null @@ -1,7 +0,0 @@ -packages: -- name: "provider-kairos" - category: "bundles" - k3s_version: "v1.21.14+k3s1" - version: "0.0.1-alpha2+k3s1.21.14" - tag: "v0.0.1-alpha2" - init: systemd \ No newline at end of file diff --git a/packages/bundles/provider-kairos/build.yaml b/packages/bundles/provider-kairos/build.yaml new file mode 100644 index 0000000..c94cd05 --- /dev/null +++ b/packages/bundles/provider-kairos/build.yaml @@ -0,0 +1,17 @@ +{{ if eq .Values.init "systemd" }} +image: golang:1.18 +prelude: +- apt-get update +- apt-get install -y git +{{ else }} +image: golang:1.18-alpine +prelude: +- apk add git +{{ end }} +- git clone https://github.com/kairos-io/provider-kairos +- PACKAGE_VERSION=${PACKAGE_VERSION%\+*} && \ + cd provider-kairos && git checkout $PACKAGE_VERSION +steps: +- cd provider-kairos && go build -o agent-provider-kairos ./ +- mv provider-kairos/agent-provider-kairos /system/providers/agent-provider-kairos +- ln -s /system/providers/agent-provider-kairos /usr/bin/kairos diff --git a/packages/bundles/provider-kairos/collection.yaml b/packages/bundles/provider-kairos/collection.yaml new file mode 100644 index 0000000..0bc2d76 --- /dev/null +++ b/packages/bundles/provider-kairos/collection.yaml @@ -0,0 +1,4 @@ +packages: +- name: "provider-kairos" + category: "bundles" + tag: "v1.2.0" \ No newline at end of file