Skip to content

Commit

Permalink
chore: reorganize recipes and repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
koehlma committed Dec 22, 2023
1 parent 8730b8d commit d1b5e10
Show file tree
Hide file tree
Showing 46 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
url = ../rugpi-template.git

[submodule "extra"]
path = extra
path = repositories/extra
url = ../rugpi-extra.git
11 changes: 10 additions & 1 deletion crates/rugpi-bakery/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ use std::{
use clap::Parser;
use colored::Colorize;
use config::load_config;
use repositories::Repositories;
use repositories::{
sources::{PathSource, Source},
Repositories,
};
use rugpi_common::Anyhow;
use tasks::{
bake::{self, BakeTask},
Expand Down Expand Up @@ -75,6 +78,12 @@ fn main() -> Anyhow<()> {
let config = load_config(&args)?;
let root_dir = std::env::current_dir()?;
let mut repositories = Repositories::new(&root_dir);
repositories.load_source(
Source::Path(PathSource {
path: "/usr/share/rugpi/repositories/core".into(),
}),
false,
)?;
repositories.load_root(config.repositories.clone(), true)?;
for (_, repository) in repositories.iter() {
println!(
Expand Down
2 changes: 1 addition & 1 deletion crates/rugpi-bakery/src/tasks/customize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn recipe_schedule(config: &BakeryConfig) -> Anyhow<Vec<RecipeJob>> {
// 1️⃣ Load builtin recipes.
let builtin_recipes_path = PathBuf::from(
env::var("RUGPI_BUILTIN_RECIPES_PATH")
.unwrap_or_else(|_| "/usr/share/rugpi/recipes".to_owned()),
.unwrap_or_else(|_| "/usr/share/rugpi/repositories/core/recipes".to_owned()),
);
library.loader().load_all(&builtin_recipes_path)?;
// 2️⃣ Load custom recipes.
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.rugpi-bakery
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ RUN mkdir -p /usr/share/rugpi \
&& mv rpi-eeprom-master rpi-eeprom \
&& rm -f rpi-eeprom-master.zip

COPY recipes /usr/share/rugpi/recipes
COPY repositories /usr/share/rugpi/repositories
COPY boot /usr/share/rugpi/boot

COPY docker/layers/bakery/10-setup.sh /tmp/rugpi-docker/10-setup.sh
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions repositories/core/rugpi-repository.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name = "rugpi"
description = "Rugpi core recipes, collections, and layers."

0 comments on commit d1b5e10

Please sign in to comment.