Skip to content

Commit

Permalink
Set testing version
Browse files Browse the repository at this point in the history
  • Loading branch information
mudler committed Dec 7, 2021
1 parent 80b6e3c commit 7e4d4b6
Show file tree
Hide file tree
Showing 15 changed files with 1,667 additions and 18 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,47 +136,47 @@ ifneq ($(shell id -u), 0)
@echo "'$@' is missing and you must be root to install it."
@exit 1
else
$(ROOT_DIR)/scripts/get_luet.sh
LUET_PACKAGE="toolchain/luet@0.20.8" $(ROOT_DIR)/scripts/get_luet.sh
endif

$(YQ):
ifneq ($(shell id -u), 0)
@echo "'$@' is missing and you must be root to install it."
@exit 1
else
$(LUET) install -y toolchain/yq
$(LUET) install -y --relax --force --nodeps toolchain/yq
endif

$(JQ):
ifneq ($(shell id -u), 0)
@echo "'$@' is missing and you must be root to install it."
@exit 1
else
$(LUET) install -y utils/jq
$(LUET) install -y --relax --force --nodeps utils/jq
endif

$(MAKEISO):
ifneq ($(shell id -u), 0)
@echo "'$@' is missing and you must be root to install it."
@exit 1
else
$(LUET) install -y toolchain/luet-makeiso
$(LUET) install -y --relax --force --nodeps toolchain/luet-makeiso
endif

$(MTREE):
ifneq ($(shell id -u), 0)
@echo "'$@' is missing and you must be root to install it."
@exit 1
else
$(LUET) install -y toolchain/luet-mtree
$(LUET) install -y --relax --force --nodeps toolchain/luet-mtree
endif

$(COSIGN):
ifneq ($(shell id -u), 0)
@echo "'$@' is missing and you must be root to install it."
@exit 1
else
$(LUET) install -y toolchain/luet-cosign toolchain/cosign
$(LUET) install -y --relax --force --nodeps toolchain/luet-cosign toolchain/cosign
endif

clean: clean_build clean_iso clean_run clean_test
Expand Down
184 changes: 184 additions & 0 deletions packages/cos-test/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
#### system/cos system/cos-container and recovery/cos start here
{{ if or (eq .Values.name "cos-container") (eq .Values.name "cos" ) }}
requires:
- name: "cos-setup"
category: "system"
version: ">=0"
- name: "installer"
category: "utils"
version: ">=0"
- name: "cloud-config"
category: "system"
version: ">=0"
- name: "immutable-rootfs"
category: "system"
version: ">=0"
- name: "cos-features"
category: "system"
version: ">=0"
- name: "grub2-config"
category: "system"
version: ">=0"
- name: "base-dracut-modules"
category: "system"
version: ">=0"
- name: "kernel"
category: "system"
version: ">=0"
- name: "dracut-initrd"
category: "system"
version: ">=0"

# https://luet-lab.github.io/docs/docs/concepts/packages/specfile/#copy
copy:
- package:
category: "toolchain"
name: "yip"
version: ">=0"
source: "/usr/bin/yip"
destination: "/usr/bin/yip"
- package:
category: "toolchain"
name: "luet"
version: ">=0"
source: "/usr/bin/luet"
destination: "/usr/bin/luet"
- package:
category: "toolchain"
name: "luet-mtree"
version: ">=0"
source: "/usr/bin/luet-mtree"
destination: "/usr/bin/luet-mtree"
- package:
category: "toolchain"
name: "yq"
version: ">=0"
source: "/usr/bin/yq"
destination: "/usr/bin/yq"
- package:
category: "toolchain"
name: "cosign"
version: ">=0"
source: "/usr/bin/cosign"
destination: "/usr/bin/cosign"
- package:
category: "toolchain"
name: "luet-cosign"
version: ">=0"
source: "/usr/bin/luet-cosign"
destination: "/usr/bin/luet-cosign"

# Templated package https://luet-lab.github.io/docs/docs/concepts/packages/templates/
steps:
- sed -i 's/:BRANDING:/{{.Values.brand_name}}/g' setup.yaml
- sed -i 's/:VERSION:/{{.Values.version}}/g' setup.yaml
- sed -i 's/:PRETTY_NAME:/{{.Values.brand_name}} v{{.Values.version}}/g' setup.yaml
- yip setup.yaml

# See https://luet-lab.github.io/docs/docs/concepts/packages/specfile/#package-by-container-content
unpack: true

# Files to exclude from the final
# artifact
# See also: https://luet-lab.github.io/docs/docs/concepts/packages/specfile/#excludingincluding-files-explictly
excludes:
- ^/var/cache/luet
- ^/luetbuild
- ^/srv/.*
- ^/root/.bash_history
- ^/run/reboot-needed

# Zypper
- ^/var/lib/zypp
- ^/var/cache/zypp
- ^/usr/share/zypper
- ^/usr/share/zypp
- ^/usr/share/zsh
- ^/usr/share/licenses/zypper
- ^/usr/bin/zypp-.*
- ^/usr/bin/zypper
- ^/usr/lib/zypp$
- ^/usr/lib/zypper
- ^/usr/lib/rpm
- ^/usr/bin/yzpper
- ^/usr/sbin/zypp-.*
- ^/usr/bin/zypp-.*
- ^/usr/bin/susetags2solv
- ^/run/zypp.*
- ^/etc/zypp
- ^/usr/bin/rpm.*
- ^/var/lib/rpm
- ^/usr/lib64/rpm-plugins
# Yast
- ^/var/lib/YaST2

#- ^/usr/local
- ^/usr/local/bin
- ^/usr/local/go
- ^/usr/local/include
- ^/usr/local/lib.*
- ^/usr/local/man
- ^/usr/local/sbin
- ^/usr/local/share
- ^/usr/local/src
- ^/usr/local/games

- ^/etc/hostname
- ^/etc/machine-id

{{ if eq .Values.name "cos-container" }}

- ^/etc/hosts
- ^/proc
- ^/sys
- ^/dev
- ^/tmp
- ^/run

{{ else }}

- ^/tmp/.*
- ^/proc/.*
- ^/sys/.*
- ^/run/.*

{{ end }}
{{- end}}
#### system/cos system/cos-container and recovery/cos end here

#### recovery/cos-img starts here
{{ if eq .Values.name "cos-img" }}
requires:
- category: "recovery"
name: "cos"
version: ">=0"
copy:
- package:
category: "recovery"
name: "cos-squash"
version: ">=0"
source: "/."
destination: "/recovery"

package_dir: "/output"
steps:
- mkdir /output
- mksquashfs /recovery /output/recovery.squashfs -b 1024k -comp xz -Xbcj x86
{{- end}}
#### recovery/cos-img ends here

#### recovery/cos-squash starts here
{{ if eq .Values.name "cos-squash" }}
requires:
- category: "recovery"
name: "cos"
version: ">=0"

requires_final_images: true
unpack: true

excludes:
- ^/var/cache/luet
- ^/luetbuild
{{- end}}
#### recovery/cos-squash ends here
23 changes: 23 additions & 0 deletions packages/cos-test/collection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
packages:
- &cos
name: "cos"
category: "system"
version: 0.7.9999
description: "cOS base image, used to build cOS live ISOs"
brand_name: "cOS"
labels:
autobump.revdeps: "true"
autobump.revbump_related: "recovery/cos-img recovery/cos-squash"
- !!merge <<: *cos
name: "cos-container"
description: "cOS container image, used to build cOS derivatives from scratch"
- !!merge <<: *cos
category: "recovery"
brand_name: "cOS recovery"
description: "cOS recovery image, used to boot cOS for troubleshooting"
- !!merge <<: *cos
name: "cos-img"
category: "recovery"
- !!merge <<: *cos
name: "cos-squash"
category: "recovery"
27 changes: 27 additions & 0 deletions packages/cos-test/setup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
stages:
default:
- name: "Default systemd config"
systemd:
enable:
- multi-user.target
- getty@tty1
mask:
- purge-kernels
commands:
- systemctl set-default multi-user.target
- name: "Setup os-release"
files:
- path: /etc/os-release
permissions: 0644
owner: 0
group: 0
environment_file: /etc/os-release
environment:
NAME: ":BRANDING:"
ID: ":BRANDING:"
ANSI_COLOR: "0;32"
BUG_REPORT_URL: "https://github.com/mudler/cOS/issues"
HOME_URL: "https://github.com/mudler/cOS"
DOCUMENTATION_URL: "https://github.com/mudler/cOS"
VERSION: ":VERSION:"
PRETTY_NAME: ":PRETTY_NAME:"
17 changes: 17 additions & 0 deletions packages/installer-test/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
requires:
- name: "base"
category: "distro"
version: ">=0"

steps:
- mkdir /usr/lib/cos
- cp -rfv installer.sh /usr/sbin/cos-installer && chmod +x /usr/sbin/cos-installer
- cp -rfv upgrade.sh /usr/sbin/cos-upgrade && chmod +x /usr/sbin/cos-upgrade
- cp -rfv reset.sh /usr/sbin/cos-reset && chmod +x /usr/sbin/cos-reset
- cp -rfv cos.sh /usr/sbin/cos && chmod +x /usr/sbin/cos
- cp -rfv deploy.sh /usr/sbin/cos-deploy && chmod +x /usr/sbin/cos-deploy
- cp -rfv suc-upgrade.sh /usr/sbin/suc-upgrade && chmod +x /usr/sbin/suc-upgrade
- cp -rfv rebrand.sh /usr/sbin/cos-rebrand && chmod +x /usr/sbin/cos-rebrand
{{ if .Values.codename }}
- sed -i 's/:FLAVOR:/{{.Values.codename}}/g' /usr/sbin/cos
{{end}}
Loading

0 comments on commit 7e4d4b6

Please sign in to comment.