Skip to content
Snippets Groups Projects
Commit 8e015dc7 authored by Frederic Danis's avatar Frederic Danis Committed by Emanuele Aina
Browse files

Create sample recipes using recipe action


APERTIS-5675

This uses the new Recipe action to merged previous recipes in one.

ROOTDIR needs to be reseted between ostree-commit and ostree-deploy
Fixes: APERTIS-5739

Signed-off-by: default avatarFrédéric Danis <frederic.danis@collabora.com>
parent baaa32c5
No related branches found
No related tags found
1 merge request!91Add example recipes to build a single image
......@@ -14,14 +14,18 @@
{{ $sampleappscheckout := or .sampleappscheckout "disabled" }}
{{ $devrootpack := or .devrootpack "disabled" }}
{{- $unpack := or .unpack "true" }}
architecture: {{ $architecture }}
actions:
{{- if eq $unpack "true" }}
- action: unpack
description: Unpack {{ $ospack }}
compression: gz
file: {{ $ospack }}.tar.gz
{{- end }}
# Add multimedia demo pack
# Provide URL via '-t demopack:"https://images.apertis.org/media/multimedia-demo.tar.gz"'
......
......@@ -13,13 +13,17 @@
{{ $demopack := "disabled" }}
{{ end }}
{{- $unpack := or .unpack "true" }}
architecture: {{ $architecture }}
actions:
{{- if eq $unpack "true" }}
- action: unpack
description: Unpack {{ $ospack }}
compression: gz
file: {{ $ospack }}.tar.gz
{{- end }}
# Add multimedia demo pack
# Provide URL via '-t demopack:"https://images.apertis.org/media/multimedia-demo.tar.gz"'
......
......@@ -13,13 +13,17 @@
{{ $demopack := "disabled" }}
{{ end }}
{{- $unpack := or .unpack "true" }}
architecture: {{ $architecture }}
actions:
{{- if eq $unpack "true" }}
- action: unpack
description: Unpack {{ $ospack }}
compression: gz
file: {{ $ospack }}.tar.gz
{{- end }}
# Add multimedia demo pack
# Provide URL via '-t demopack:"https://images.apertis.org/media/multimedia-demo.tar.gz"'
......
......@@ -4,6 +4,7 @@
{{- $suite := or .suite "v2019dev0" -}}
{{- $timestamp := or .timestamp "" -}}
{{- $ospack := or .ospack (printf "ospack_%s-%s-%s" $suite $architecture $type) -}}
{{- $pack := or .pack "true" -}}
architecture: {{ $architecture }}
......@@ -557,6 +558,7 @@ actions:
description: "Drop resolv.conf so the appropriate one gets created at runtime"
command: rm "${ROOTDIR}/etc/resolv.conf"
{{- if eq $pack "true" }}
- action: run
description: "Save installed package status"
chroot: false
......@@ -570,3 +572,4 @@ actions:
- action: pack
compression: gz
file: {{ $ospack }}.tar.gz
{{- end }}
......@@ -5,6 +5,7 @@
{{- $timestamp := or .timestamp "" -}}
{{- $ospack := or .ospack (printf "ospack_%s-%s-%s" $suite $architecture $type) -}}
{{- $lxc := or .lxc "enabled" -}}
{{- $pack := or .pack "true" -}}
architecture: {{ $architecture }}
......@@ -174,6 +175,7 @@ actions:
description: "Drop resolv.conf so the appropriate one gets created at runtime"
command: rm "${ROOTDIR}/etc/resolv.conf"
{{- if eq $pack "true" }}
- action: run
description: "Save installed package status"
chroot: false
......@@ -187,3 +189,4 @@ actions:
- action: pack
compression: gz
file: {{ $ospack }}.tar.gz
{{- end }}
......@@ -5,6 +5,7 @@
{{- $timestamp := or .timestamp "" -}}
{{- $ospack := or .ospack (printf "ospack_%s-%s-%s" $suite $architecture $type) -}}
{{- $lxc := or .lxc "enabled" -}}
{{- $pack := or .pack "true" }}
architecture: {{ $architecture }}
......@@ -759,6 +760,7 @@ actions:
description: "Drop resolv.conf so the appropriate one gets created at runtime"
command: rm "${ROOTDIR}/etc/resolv.conf"
{{- if eq $pack "true" }}
- action: run
description: "Save installed package status"
chroot: false
......@@ -772,3 +774,4 @@ actions:
- action: pack
compression: gz
file: {{ $ospack }}.tar.gz
{{- end }}
......@@ -6,6 +6,7 @@
{{- $ospack := or .ospack (printf "ospack_%s-%s-%s" $suite $architecture $type) -}}
{{- $ivitools := or .ivitools "enabled" -}}
{{- $lxc := or .lxc "disabled" -}}
{{- $pack := or .pack "true" -}}
architecture: {{ $architecture }}
......@@ -283,6 +284,7 @@ actions:
description: "Drop resolv.conf so the appropriate one gets created at runtime"
command: rm "${ROOTDIR}/etc/resolv.conf"
{{- if eq $pack "true" }}
- action: run
description: "Save installed package status"
chroot: false
......@@ -296,3 +298,4 @@ actions:
- action: pack
compression: gz
file: {{ $ospack }}.tar.gz
{{- end }}
......@@ -9,12 +9,15 @@
{{ $image := or .image (printf "apertis-ostree-%s-%s-%s" $suite $type $architecture) }}
{{ $ostree := or .ostree "repo" }}
{{ $message := or .message "Update" }}
{{- $unpack := or .unpack "true" }}
architecture: {{ $architecture }}
actions:
{{- if eq $unpack "true" }}
- action: unpack
file: {{ $ospack }}.tar.gz
{{- end }}
- action: overlay
description: "Install ostree feature"
......
{{- $architecture := "armhf" }}
{{- $type := "minimal" }}
{{- $mirror := "https://repositories.apertis.org/apertis/" }}
{{- $suite := "v2019dev0" }}
{{- $timestamp := "00000000.0" }}
{{- $image := (printf "apertis-sample-development-%s-%s-%s_%s" $suite $type $architecture $timestamp) }}
architecture: {{ $architecture }}
actions:
- action: recipe
description: Create ospack for {{ $suite }} {{ $type }} {{ $architecture }}
recipe: apertis-ospack-{{ $type }}.yaml
variables:
type: {{ $type }}
mirror: {{ $mirror }}
suite: {{ $suite }}
timestamp: {{ $timestamp }}
pack: false
# Package up everything in a image
- action: recipe
description: Create image {{ $image }} for {{ $suite }} {{ $type }} {{ $architecture }}
recipe: apertis-image-uboot.yaml
variables:
type: {{ $type }}
mirror: {{ $mirror }}
suite: {{ $suite }}
timestamp: {{ $timestamp }}
image: {{ $image }}
unpack: false
{{- $architecture := "armhf" }}
{{- $type := "minimal" }}
{{- $mirror := "https://repositories.apertis.org/apertis/" }}
{{- $suite := "v2019dev0" }}
{{- $timestamp := "00000000.0" }}
{{- $image := (printf "apertis-sample-production-%s-%s-%s_%s" $suite $type $architecture $timestamp) }}
{{ $board := "uboot" }}
{{ $osname := "apertis" }}
{{ $branch := (printf "%s/%s/%s-%s/%s" $osname $suite $architecture $board $type) }}
{{ $ostree := "repo" }}
{{ $repourl := (printf "${ARTIFACTDIR}/%s" $ostree) }}
architecture: {{ $architecture }}
actions:
- action: run
description: Create local OSTree repository
chroot: false
command: ostree init --mode archive --repo=${ARTIFACTDIR}/{{ $ostree }}
# Create base rootfs
- action: recipe
description: Create ospack for {{ $suite }} {{ $type }} {{ $architecture }}
recipe: apertis-ospack-{{ $type }}.yaml
variables:
type: {{ $type }}
mirror: {{ $mirror }}
suite: {{ $suite }}
timestamp: {{ $timestamp }}
pack: false
# Adapt and commit OSTree based on rootfs created during previous action
- action: recipe
description: OSTree commit for {{ $suite }} {{ $type }} {{ $architecture }}
recipe: apertis-ostree-commit.yaml
variables:
type: {{ $type }}
suite: {{ $suite }}
timestamp: {{ $timestamp }}
board: {{ $board }}
branch: {{ $branch }}
image: {{ $image }}
ostree: {{ $ostree }}
unpack: false
# Reset the rootfs to allow to deploy OSTree from a clean rootfs
- action: run
description: Reset rootfs before deploying OSTree
chroot: false
command: find ${ROOTDIR} -maxdepth 1 -mindepth 1 -exec rm -rf {} \;
# Package up everything in a image
- action: recipe
description: Create image {{ $image }} for {{ $suite }} {{ $type }} {{ $architecture }}
recipe: apertis-ostree-image-uboot.yaml
variables:
type: {{ $type }}
suite: {{ $suite }}
image: {{ $image }}
board: {{ $board }}
repourl: {{ $repourl }}
branch: {{ $branch }}
ostree: {{ $ostree }}
{{- $architecture := "amd64" }}
{{- $type := "basesdk" }}
{{- $mirror := "https://repositories.apertis.org/apertis/" }}
{{- $suite := "v2019dev0" }}
{{- $timestamp := "00000000.0" }}
{{- $image := (printf "apertis-sample-sdk-%s-%s-%s_%s" $suite $type $architecture $timestamp) }}
{{- $devrootpack := or .devrootpack "disabled" }}
architecture: {{ $architecture }}
actions:
# Create base rootfs for the Base SDK
- action: recipe
description: Create ospack for {{ $suite }} {{ $type }} {{ $architecture }}
recipe: apertis-ospack-{{ $type }}.yaml
variables:
type: {{ $type }}
mirror: {{ $mirror }}
suite: {{ $suite }}
timestamp: {{ $timestamp }}
pack: false
# Package up everything in a image for VirtualBox
- action: recipe
description: Create image {{ $image }} for {{ $suite }} {{ $type }} {{ $architecture }}
recipe: apertis-image-sdk.yaml
variables:
type: {{ $type }}
mirror: {{ $mirror }}
suite: {{ $suite }}
timestamp: {{ $timestamp }}
image: {{ $image }}
devrootpack: {{ $devrootpack }}
unpack: false
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment