Skip to content

Commit 0ca1e65

Browse files
authored
use main tag by default (#25)
1 parent 2eb1d1a commit 0ca1e65

File tree

3 files changed

+5
-24
lines changed

3 files changed

+5
-24
lines changed

src/build/containers.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@ use tempdir::TempDir;
44
use tokio_stream::StreamExt;
55

66
use anyhow::Context;
7-
use bedrock::Config;
87
use colored::Colorize;
98
use tokio::{io::AsyncWriteExt, process::Command};
109
use tokio_process_stream::ProcessLineStream;
1110
use tokio_tar::Archive;
1211

1312
use crate::cli::ContainerBackend;
1413

15-
const APP_VERSION: &str = env!("CARGO_PKG_VERSION");
16-
1714
lazy_static! {
1815
static ref ANSI_REGEX: Regex = Regex::new(r"\x1b\[[0-9;]*[A-Za-z]").unwrap();
1916
}
@@ -100,22 +97,6 @@ pub async fn build_container_image(
10097
}
10198
}
10299

103-
/// Based on the config, determine which tag to use
104-
pub fn get_server_tag(cfg: &Config) -> String {
105-
let needs_scripting = !cfg.integrations.event_handlers.is_empty();
106-
let needs_webhooks = !cfg.integrations.webhooks.is_empty();
107-
let variant = if needs_scripting && needs_webhooks {
108-
"full"
109-
} else if needs_scripting {
110-
"scripting"
111-
} else if needs_webhooks {
112-
"webhooks"
113-
} else {
114-
"minimal"
115-
};
116-
format!("{APP_VERSION}-{variant}")
117-
}
118-
119100
pub async fn ensure_podman_accessible() -> anyhow::Result<()> {
120101
Command::new("podman")
121102
.output()

src/build/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use containers::{build_container_image, get_server_tag};
1+
use containers::build_container_image;
22
use std::path::{Path, PathBuf};
33
use tar_helpers::{append_event_handlers, make_base_init, make_base_install, make_header};
44

@@ -16,7 +16,7 @@ const INSTALL_SRC: &str = include_str!("../../data/install.sh");
1616
const ENTRY_SRC: &str = include_str!("../../data/entrypoint.sh");
1717
const DOCKER_IGNORE: &str = "./Dockerfile\n./.dockerignore";
1818

19-
const APP_VERSION: &str = env!("CARGO_PKG_VERSION");
19+
const DEFAULT_TAG: &str = "main";
2020

2121
lazy_static! {
2222
static ref tmpl: tera::Tera = {
@@ -55,11 +55,11 @@ pub async fn build_with_output(
5555
let mut ctx = tera::Context::new();
5656
ctx.insert(
5757
"server_tag",
58-
&std::env::var("BASALT_SERVER_TAG").unwrap_or_else(|_| get_server_tag(&cfg)),
58+
&std::env::var("BASALT_SERVER_TAG").unwrap_or(DEFAULT_TAG.to_owned()),
5959
);
6060
ctx.insert(
6161
"web_tag",
62-
&std::env::var("BASALT_WEB_TAG").unwrap_or(APP_VERSION.to_owned()),
62+
&std::env::var("BASALT_WEB_TAG").unwrap_or(DEFAULT_TAG.to_owned()),
6363
);
6464
ctx.insert("base_install", &make_base_install(&cfg));
6565
ctx.insert("base_init", &make_base_init(&cfg));

tests/one.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ port = 8517
55

66
# install = { import = "./install.sh" }
77
install = '''
8-
dnf install opam
8+
dnf install -y opam
99
'''
1010

1111
# init = { import = "./init.sh" }

0 commit comments

Comments
 (0)