Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: modular rewrite (#103) #135

Merged
merged 83 commits into from
Sep 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
9950409
chore: outline rewrite without code changes
xynydev Aug 9, 2023
4325e65
chore: refactor code to support new structure
xynydev Aug 9, 2023
6b150cc
chore: rewriting some parts, new recipe location
xynydev Aug 9, 2023
40be688
chore: also copy modules directory into img build
xynydev Aug 9, 2023
6b64c6e
chore: remove wallpaper rpm installation (for now)
xynydev Aug 9, 2023
7b9faf6
fix: bad yq command syntax
xynydev Aug 9, 2023
e537d65
chore: investigate reading module array
xynydev Aug 9, 2023
2b633ff
fix: make get_yaml_array work
xynydev Aug 13, 2023
245fc69
chore: launch modules, detect if module inline
xynydev Aug 13, 2023
057b45a
refactor: remove get yml string, add configdir var
xynydev Aug 13, 2023
d0c6dee
feat: running modules from files
xynydev Aug 13, 2023
59e1604
fix: remove trailing slashes from directory vars
xynydev Aug 13, 2023
055ef73
fix: bad indentation in common-packages.yml
xynydev Aug 13, 2023
cb06318
chore: export config directory
xynydev Aug 13, 2023
e03ac5d
feat: script runner module
xynydev Aug 13, 2023
c27685f
refactor: export get_yaml_array
xynydev Aug 13, 2023
18d1b3d
Revert "refactor: export get_yaml_array"
xynydev Aug 13, 2023
7fea9a1
Merge branch 'template' into modular-rewrite
xynydev Aug 13, 2023
9ad0048
refactor: global get_yaml_array function
xynydev Aug 13, 2023
b2034c7
feat: rpm-ostree module
xynydev Aug 13, 2023
290075c
feat: yafti module
xynydev Aug 13, 2023
8e80937
docs: better inline docs and prints
xynydev Aug 13, 2023
93cd25f
fix: also install and enable yafti in yafti module
xynydev Aug 13, 2023
8f0aa9c
chore: export more vars as readonly
xynydev Aug 13, 2023
1d7b14b
feat: signing script
xynydev Aug 13, 2023
38dda90
refactor: rename fedora version to os version
xynydev Aug 13, 2023
14d78ee
fix: can't set readonly var after declaration
xynydev Aug 13, 2023
c4b274b
chore: investigate "no such file or directory"
xynydev Aug 13, 2023
3e0aa46
chore: investigate "no such file or directory"
xynydev Aug 13, 2023
bbb1cc8
fix: give executable permission to scripts
xynydev Aug 13, 2023
dc97fa4
fix: don't run arbitrary commands with script
xynydev Aug 13, 2023
c07131b
docs: move & start rewriting configuration docs
xynydev Aug 13, 2023
c0bc388
chore: remove changelog
xynydev Aug 26, 2023
bca8b81
docs: a ginormous amount of docs for the modules
xynydev Aug 26, 2023
9e301ce
chore!: remove autorun.sh
xynydev Aug 26, 2023
618401d
chore: bring recipe.yml to a default state
xynydev Aug 26, 2023
1d7a3a9
chore: remove outdated script-related docs
xynydev Aug 26, 2023
81dca63
chore: clean up bling a bit
xynydev Aug 26, 2023
7b036d3
feat: ublue-os/bling module
xynydev Aug 26, 2023
7401763
chore: clean build.yml, make matrix more visible
xynydev Aug 26, 2023
3c773d7
chore: remove empty usr/bin dir
xynydev Aug 26, 2023
5cd245c
docs: expand main customization section
xynydev Aug 26, 2023
fc2f4bb
chore!: remove setup-flatpaks
xynydev Aug 26, 2023
09c22d5
docs: rewrite the just section
xynydev Aug 26, 2023
c2367e0
chore: re-add branch selection for push
xynydev Aug 26, 2023
e27eb25
fix: newlines in rpm-ostree cmds errors
xynydev Aug 26, 2023
2740320
fix: don't output yaml array as json
xynydev Aug 26, 2023
26e4f0c
chore: revert
xynydev Aug 26, 2023
d2eeae7
docs: document added/removed packages
xynydev Aug 26, 2023
80c4094
chore: rm ublue-os/startingpoint in iso docs
xynydev Aug 27, 2023
5a1a687
chore: use same package inst/rm logic as upstream
xynydev Aug 27, 2023
c8db9df
Merge branch 'template' into modular-rewrite
xynydev Aug 27, 2023
3f35fe7
chore: try removing pkgs to remove?
xynydev Aug 27, 2023
67cf52e
Merge branch 'modular-rewrite' of github.com:ublue-os/startingpoint i…
xynydev Aug 27, 2023
961dff3
fix: put .sh suffix outside of quotes?
xynydev Aug 27, 2023
949b06f
fix: remove trailing newline from $ITEM
xynydev Aug 27, 2023
019603f
docs: some more inline docs for modules
xynydev Aug 27, 2023
5ff623b
chore: try removing something other than ff
xynydev Aug 27, 2023
00b6920
fix: rm newlines from rpm-ostree cmds
xynydev Aug 27, 2023
fd2ca76
chore: revert recipe to default configuration
xynydev Aug 27, 2023
4ce8e91
fix: ? remove quotes, add wordsplitting
xynydev Aug 27, 2023
ac8be6e
chore: back to array syntax in rpm-ostree
xynydev Aug 29, 2023
77699e8
chore: Revert "chore: back to array syntax in rpm-ostree"
xynydev Aug 29, 2023
2208ea8
fix: remove ub update services in ub updater inst
xynydev Sep 2, 2023
54cd605
feat: integrate optfix into rpm-ostree module
xynydev Sep 2, 2023
25ac5dd
docs: fix: it's not dnkmmr it's determinate
xynydev Sep 2, 2023
60fa5ca
fix: remove newlines before wget
xynydev Sep 2, 2023
d2ab95c
fix: bling justfile installer nested just dir
xynydev Sep 2, 2023
e5fdb30
fix: some more bling installer file copy issues
xynydev Sep 2, 2023
eb37ec3
fix: move globs outside of ""
xynydev Sep 2, 2023
cc90a91
feat: added systemd and files module (#142)
gerblesh Sep 5, 2023
8f76fd6
Merge branch 'template' into modular-rewrite
xynydev Sep 5, 2023
3f2ef28
fix: removed issues in rpm-ostree module and ublue-update bling insta…
gerblesh Sep 8, 2023
b3ddcd8
fix: add .sh suffix for dconf update service inst
xynydev Sep 9, 2023
15b3d39
docs: some docs fixes, better formatting, etc
xynydev Sep 9, 2023
61ed483
feat: yafti module installs yafti deps
xynydev Sep 9, 2023
dcefa76
docs: missing space
xynydev Sep 9, 2023
c3bc555
feat: enable dconf update service in installer
xynydev Sep 9, 2023
c10f7e7
docs: mention depsolve & more info in walkthrough
xynydev Sep 9, 2023
311dfe2
chore: don't use _STR like array
xynydev Sep 9, 2023
b4d1d0d
docs: add notice of rewrite
xynydev Sep 9, 2023
393d54e
docs: point reader toward discovering new features
xynydev Sep 9, 2023
4e0095b
refactor: fetch modules from bling
xynydev Sep 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 22 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,30 @@
# This workflow builds every branch of the repository daily at 20:22 UTC, one hour after ublue-os/nvidia builds.
# The images are also built after pushuing changes or pull requests.
# The builds can also be triggered manually in the Actions tab thanks to workflow dispatch.
# Only the branch called `live` is published.


name: build-ublue
on:
# Build *every* branch at 10:20pm UTC every day (1 hr delay after "nvidia" builds),
# regardless of the branch names. (Not just "live, template and main" branches.)
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
on: # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
schedule:
- cron: "20 22 * * *"
# Build automatically after pushing commits or tags to the "live", "template"
# or "main" branches, except when the commit only affects "documentation" text files.
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push
push:
branches:
- live
- template
- main
paths-ignore:
paths-ignore: # don't rebuild if only documentation has changed
- "**.md"
- "**.txt"
# Build pull requests whenever they are opened or updated, to make sure they
# work. The build won't be deployed, since we filter out PRs in the deployment
# stage. Note that submitted PRs run the workflow of the *fork's* own primary
# branch, using the fork's own secrets/environment. Please be sure to sync
# your primary branch with upstream's latest workflow before submitting PRs!
# For pull requests, we build *any* branch regardless of name, to allow "build
# checks" to succeed for typical PR branch names such as "fix-something".
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
pull_request:
# Build when manually triggering this workflow for a branch. This allows you
# to build any branch, even if it's not listed in the automated triggers above.
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch
workflow_dispatch:

env:
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}

# Only deploys the branch named "live". Ignores all other branches, to allow
# having "development" branches without interfering with GHCR image uploads.
jobs:
push-ghcr:
# Only deploys the branch named "live". Ignores all other branches, to allow
# having "development" branches without interfering with GHCR image uploads.
name: Build and push image
runs-on: ubuntu-22.04
permissions:
Expand All @@ -45,29 +33,34 @@ jobs:
id-token: write
strategy:
fail-fast: false

matrix:
# !!!
# Add recipes for all the images you want to build here.
# Don't add module configuration files, you will get errors.
recipe:
- recipe.yml
# !!!

steps:
# Checkout push-to-registry action GitHub repository
- name: Checkout Push to Registry action
uses: actions/checkout@v3

- name: Add yq for reading recipe.yml
- name: Add yq (for reading recipe.yml)
uses: mikefarah/yq@v4.34.2

- name: Gather image data from recipe
run: |
echo "IMAGE_NAME=$(yq '.name' ./${{ matrix.recipe }})" >> $GITHUB_ENV
echo "IMAGE_DESCRIPTION=$(yq '.description' ./${{ matrix.recipe }})" >> $GITHUB_ENV
echo "FEDORA_MAJOR_VERSION=$(yq '.fedora-version' ./${{ matrix.recipe }})" >> $GITHUB_ENV
echo "BASE_IMAGE_URL=$(yq '.base-image' ./${{ matrix.recipe }})" >> $GITHUB_ENV
echo "IMAGE_NAME=$(yq '.name' ./config/${{ matrix.recipe }})" >> $GITHUB_ENV
echo "IMAGE_DESCRIPTION=$(yq '.description' ./config/${{ matrix.recipe }})" >> $GITHUB_ENV
echo "IMAGE_MAJOR_VERSION=$(yq '.image-version' ./config/${{ matrix.recipe }})" >> $GITHUB_ENV
echo "BASE_IMAGE_URL=$(yq '.base-image' ./config/${{ matrix.recipe }})" >> $GITHUB_ENV

- name: Get current version
id: labels
run: |
ver=$(skopeo inspect docker://${{ env.BASE_IMAGE_URL }}:${{ env.FEDORA_MAJOR_VERSION }} | jq -r '.Labels["org.opencontainers.image.version"]')
ver=$(skopeo inspect docker://${{ env.BASE_IMAGE_URL }}:${{ env.IMAGE_MAJOR_VERSION }} | jq -r '.Labels["org.opencontainers.image.version"]')
echo "VERSION=$ver" >> $GITHUB_OUTPUT

- name: Generate tags
Expand Down Expand Up @@ -147,7 +140,7 @@ jobs:
tags: |
${{ steps.generate-tags.outputs.alias_tags }}
build-args: |
FEDORA_MAJOR_VERSION=${{ env.FEDORA_MAJOR_VERSION }}
IMAGE_MAJOR_VERSION=${{ env.IMAGE_MAJOR_VERSION }}
BASE_IMAGE_URL=${{ env.BASE_IMAGE_URL }}
RECIPE=${{ matrix.recipe }}
IMAGE_REGISTRY=${{ steps.registry_case.outputs.lowercase }}
Expand Down
46 changes: 0 additions & 46 deletions CHANGELOG.md

This file was deleted.

64 changes: 27 additions & 37 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,57 +1,47 @@
# This is the Containerfile for your custom image.
# This is the Containerfile for your custom image.

# It takes in the recipe, version, and base image as arguments,
# Instead of adding RUN statements here, you should consider creating a script
# in `config/scripts/`. Read more in `modules/script/README.md`

# This Containerfile takes in the recipe, version, and base image as arguments,
# all of which are provided by build.yml when doing builds
# in the cloud. The ARGs have default values, but changing those
# does nothing if the image is built in the cloud.

ARG FEDORA_MAJOR_VERSION=38
# Warning: changing this might not do anything for you. Read comment above.
# !! Warning: changing these might not do anything for you. Read comment above.
ARG IMAGE_MAJOR_VERSION=38
ARG BASE_IMAGE_URL=ghcr.io/ublue-os/silverblue-main

FROM ${BASE_IMAGE_URL}:${FEDORA_MAJOR_VERSION}

# The default recipe set to the recipe's default filename
# so that `podman build` should just work for many people.
ARG RECIPE=./recipe.yml
FROM ${BASE_IMAGE_URL}:${IMAGE_MAJOR_VERSION}

# The default recipe is set to the recipe's default filename
# so that `podman build` should just work for most people.
ARG RECIPE=recipe.yml
# The default image registry to write to policy.json and cosign.yaml
ARG IMAGE_REGISTRY=ghcr.io/ublue-os

# Copy static configurations and component files.
# Warning: If you want to place anything in "/etc" of the final image, you MUST
# place them in "./usr/etc" in your repo, so that they're written to "/usr/etc"
# on the final system. That is the proper directory for "system" configuration
# templates on immutable Fedora distros, whereas the normal "/etc" is ONLY meant
# for manual overrides and editing by the machine's admin AFTER installation!
# See issue #28 (https://github.com/ublue-os/startingpoint/issues/28).
COPY usr /usr

# Copy public key
COPY cosign.pub /usr/share/ublue-os/cosign.pub

# Copy the recipe that we're building.
COPY ${RECIPE} /usr/share/ublue-os/recipe.yml
# Copy the bling from ublue-os/bling into tmp, to be installed later by the bling module
# Feel free to remove these lines if you want to speed up image builds and don't want any bling
COPY --from=ghcr.io/ublue-os/bling:latest /rpms /tmp/bling/rpms
COPY --from=ghcr.io/ublue-os/bling:latest /files /tmp/bling/files

# Copy nix install script and Universal Blue wallpapers RPM from Bling image
COPY --from=ghcr.io/ublue-os/bling:latest /rpms/ublue-os-wallpapers-0.1-1.fc38.noarch.rpm /tmp/ublue-os-wallpapers-0.1-1.fc38.noarch.rpm
# Copy build scripts & configuration
COPY build.sh /tmp/build.sh
COPY config /tmp/config/

# Integrate bling justfiles onto image
COPY --from=ghcr.io/ublue-os/bling:latest /files/usr/share/ublue-os/just /usr/share/ublue-os/just
# Copy modules
# The default modules are inside ublue-os/bling
COPY --from=ghcr.io/ublue-os/bling:latest /modules /tmp/modules/
# Custom modules overwrite defaults
COPY modules /tmp/modules/

# Add nix installer if you want to use it
COPY --from=ghcr.io/ublue-os/bling:latest /files/usr/bin/ublue-nix* /usr/bin

# "yq" used in build.sh and the "setup-flatpaks" just-action to read recipe.yml.
# Copied from the official container image since it's not available as an RPM.
# `yq` is used for parsing the yaml configuration
# It is copied from the official container image since it's not available as an RPM.
COPY --from=docker.io/mikefarah/yq /usr/bin/yq /usr/bin/yq

# Copy the build script and all custom scripts.
COPY scripts /tmp/scripts

# Run the build script, then clean up temp files and finalize container build.
RUN rpm-ostree install /tmp/ublue-os-wallpapers-0.1-1.fc38.noarch.rpm && \
chmod +x /tmp/scripts/build.sh && \
/tmp/scripts/build.sh && \
rm -rf /tmp/* /var/* && \
ostree container commit
RUN chmod +x /tmp/build.sh && /tmp/build.sh && \
rm -rf /tmp/* /var/* && ostree container commit
Loading