adding packaging

This commit is contained in:
Philippe Caseiro 2022-12-02 14:26:25 +01:00
parent 41f93fcf15
commit 6435d0e844
4 changed files with 66 additions and 7 deletions

9
Makefile Normal file
View File

@ -0,0 +1,9 @@
SHELL := /bin/bash
apk:
nfpm package -p apk
deb:
nfpm package -p deb
rpm:
nfpm package -p rpm

View File

@ -1,9 +1,10 @@
#!ipxe
set ignition-server 192.168.40.3
set ignition-server MY_IP_HERE
#set base-url http://${ignition-server}/flatcar
set base-url http://stable.release.flatcar-linux.net/amd64-usr/current
set vm-install-target /dev/vda
set bm-install-target /dev/sda
:start
menu Cadoles PXE Boot Options
@ -26,40 +27,40 @@ choose --default exit --timeout 10000 option && goto ${option}
shell
:klead
set ignition-url http://${ignition-server}/leader.json
set ignition-url http://${ignition-server}/os/leader.json
kernel ${base-url}/flatcar_production_pxe.vmlinuz initrd=flatcar_production_pxe_image.cpio.gz flatcar.first_boot=1 ignition.config.url=${ignition-url}
initrd ${base-url}/flatcar_production_pxe_image.cpio.gz
boot
:kmaster
set ignition-url http://${ignition-server}/leader.json
set ignition-url http://${ignition-server}/os/leader.json
kernel ${base-url}/flatcar_production_pxe.vmlinuz initrd=flatcar_production_pxe_image.cpio.gz flatcar.first_boot=1 ignition.config.url=${ignition-url}
initrd ${base-url}/flatcar_production_pxe_image.cpio.gz
:knode
set ignition-url http://${ignition-server}/leader.json
set ignition-url http://${ignition-server}/os/leader.json
kernel ${base-url}/flatcar_production_pxe.vmlinuz initrd=flatcar_production_pxe_image.cpio.gz flatcar.first_boot=1 ignition.config.url=${ignition-url}
initrd ${base-url}/flatcar_production_pxe_image.cpio.gz
:iklead
set ignition-url http://${ignition-server}/leader-install.json
set ignition-url http://${ignition-server}/os/leader-install.json
kernel ${base-url}/flatcar_production_pxe.vmlinuz initrd=flatcar_production_pxe_image.cpio.gz flatcar.first_boot=1 flatcar.target=${vm-install-target} ignition.config.url=${ignition-url}
initrd ${base-url}/flatcar_production_pxe_image.cpio.gz
boot
:iknode
set ignition-url http://${ignition-server}/leader.json
set ignition-url http://${ignition-server}/os/leader.json
kernel ${base-url}/flatcar_production_pxe.vmlinuz initrd=flatcar_production_pxe_image.cpio.gz flatcar.first_boot=1 flatcar.target=${vm-install-target} ignition.config.url=${ignition-url}
initrd ${base-url}/flatcar_production_pxe_image.cpio.gz
boot
:iknode
set ignition-url http://${ignition-server}/leader.json
set ignition-url http://${ignition-server}/os/leader.json
kernel ${base-url}/flatcar_production_pxe.vmlinuz initrd=flatcar_production_pxe_image.cpio.gz flatcar.first_boot=1 flatcar.target=${vm-install-target} ignition.config.url=${ignition-url}
initrd ${base-url}/flatcar_production_pxe_image.cpio.gz

View File

@ -0,0 +1,8 @@
#!/bin/sh
ip=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1)
sed -i -e "s/MY_IP_HERE/${ip}/g" /srv/tftpboot/menu/boot.ipxe
service dnsmasq start
service mini_httpd start

41
nfpm.yaml Normal file
View File

@ -0,0 +1,41 @@
# nfpm example config file
#
# check https://nfpm.goreleaser.com/configuration for detailed usage
#
name: "ckube-pxe"
arch: "amd64"
platform: "linux"
version: "v0.0.1"
section: "default"
priority: "extra"
maintainer: "Cadoles <contact@cadoles.com>"
description: |
CadolesKube OS Installer (iPXE)
vendor: "Cadoles"
homepage: "https://www.cadoles.com"
license: "GPL-v3"
changelog: "changelog.yaml"
contents:
- src: butane
dst: /srv/os/butane
- src: /srv/os/butane
dst: /var/www/localhost/htdocs/os
type: symlink
- src: ipxe/etc/dnsmasq.d
dst: /etc
- src: ipxe/tftpboot
dst: /srv/tftpboot
scripts:
postinstall: ./misc/scripts/basic-setup.sh
overrides:
apk:
depends:
- dnsmasq
- dnsmasq-openrc
- dnsmasq-common
- alpine-ipxe
- mini_httpd