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

The Cleansing #207

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 0 additions & 25 deletions .env.example

This file was deleted.

12 changes: 0 additions & 12 deletions .env.vault

This file was deleted.

12 changes: 0 additions & 12 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
{
"sqltools.connections": [
{
"previewLimit": 50,
"server": "localhost",
"port": 5432,
"driver": "PostgreSQL",
"name": "anda",
"database": "anda",
"username": "postgres",
"password": "example"
}
],
"rust-analyzer.checkOnSave.command": "clippy",
"search.useGlobalIgnoreFiles": true,
"files.exclude": {
Expand Down
33 changes: 0 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description = "Andaman Build toolchain"
license = "MIT"
repository = "https://github.com/FyraLabs/anda"
readme = "README.md"
keywords = ["build", "toolchain", "rpm", "flatpak", "oci"]
keywords = ["build", "toolchain", "rpm"]
exclude = [
"anda-build",
"anda-config",
Expand All @@ -29,7 +29,6 @@ walkdir = "2.5.0"
tempfile = "3.14.0"
anda-config = { workspace = true }
andax = { path = "./andax", version = "0.3.1" }
flatpak = "0.18.1"
clap-verbosity-flag = "2.2.2"
tokio = { version = "1.41.1", features = [
"process",
Expand Down
24 changes: 0 additions & 24 deletions anda-config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ impl Manifest {
#[derive(Deserialize, PartialEq, Eq, Serialize, Debug, Clone, Default)]
pub struct Project {
pub rpm: Option<RpmBuild>,
pub podman: Option<Docker>,
pub docker: Option<Docker>,
pub flatpak: Option<Flatpak>,
pub pre_script: Option<PathBuf>,
pub post_script: Option<PathBuf>,
pub env: Option<BTreeMap<String, String>>,
Expand Down Expand Up @@ -191,11 +188,6 @@ pub struct RpmBuild {
pub opts: Option<BTreeMap<String, String>>,
}

#[derive(Deserialize, PartialEq, Eq, Serialize, Debug, Clone, Default)]
pub struct Docker {
pub image: BTreeMap<String, DockerImage>, // tag, file
}

pub fn parse_kv(input: &str) -> impl Iterator<Item = Option<(String, String)>> + '_ {
input
.split(',')
Expand All @@ -212,22 +204,6 @@ pub fn parse_labels<'a, I: Iterator<Item = &'a str>>(labels: I) -> Option<Vec<(S
labels.flat_map(parse_kv).collect()
}

#[derive(Deserialize, PartialEq, Eq, Serialize, Debug, Clone, Default)]
pub struct DockerImage {
pub dockerfile: Option<String>,
pub import: Option<PathBuf>,
pub tag_latest: Option<bool>,
pub context: String,
pub version: Option<String>,
}

#[derive(Deserialize, PartialEq, Eq, Serialize, Debug, Clone)]
pub struct Flatpak {
pub manifest: PathBuf,
pub pre_script: Option<PathBuf>,
pub post_script: Option<PathBuf>,
}

/// Converts a [`Manifest`] to `String` (.hcl).
///
/// # Errors
Expand Down
33 changes: 0 additions & 33 deletions andax/fns/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ pub mod ar {
p.insert(name.into(), {
let mut p = rhai::Map::new();
p.insert("rpm".into(), _rpm(proj.rpm));
p.insert("podman".into(), _docker(proj.podman));
p.insert("docker".into(), _docker(proj.docker));
p.insert("flatpak".into(), _flatpak(proj.flatpak));
p.insert("pre_script".into(), _pb(proj.pre_script));
p.insert("post_script".into(), _pb(proj.post_script));
p.insert("env".into(), proj.env.unwrap_or_default().into());
Expand Down Expand Up @@ -67,33 +64,3 @@ fn _rpm(o: Option<anda_config::RpmBuild>) -> Dynamic {
m.into()
})
}
fn _docker(o: Option<anda_config::Docker>) -> Dynamic {
o.map_or(().into(), |d| {
let mut m = rhai::Map::new();
m.insert(
"image".into(),
d.image
.into_iter()
.map(|(n, i)| {
let mut a = rhai::Map::new();
a.insert("dockerfile".into(), i.dockerfile.unwrap_or_default().into());
a.insert("import".into(), _pb(i.import));
a.insert("tag_latest".into(), i.tag_latest.unwrap_or(false).into());
a.insert("context".into(), i.context.into());
a.insert("version".into(), i.version.unwrap_or_default().into());
(n, a)
})
.collect(),
);
m.into()
})
}
fn _flatpak(o: Option<anda_config::Flatpak>) -> Dynamic {
o.map_or(().into(), |f| {
let mut m = rhai::Map::new();
m.insert("manifest".into(), _pb(Some(f.manifest)));
m.insert("pre_script".into(), _pb(f.pre_script));
m.insert("post_script".into(), _pb(f.post_script));
m.into()
})
}
Loading