Skip to content
Merged
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
4 changes: 4 additions & 0 deletions docs/EdgeApps.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ The `syntax` field specifies the version of the manifest file. The current versi

The `id` field is a unique identifier for the Edge App. This ID is generated by the system and is used to identify the Edge App across the platform.

> **Deprecated:** Reading the `id` from `screenly.yml` is deprecated. Set the `EDGE_APP_ID` environment variable instead — for example, via a repo secret in CI or a local `.env` file loaded into your shell. When `EDGE_APP_ID` is set, it takes priority over the manifest's `id` field. The CLI still falls back to reading `id` from `screenly.yml` for now, but prints a deprecation warning each time it does.
Comment thread
nicomiguelino marked this conversation as resolved.
>
> `screenly edge-app create` and `screenly edge-app create --in-place` also respect `EDGE_APP_ID`: if it's set, the CLI verifies that Edge App exists and uses it instead of creating a new one, without writing anything into `screenly.yml`. This means any name you pass to `create` is ignored for the purpose of choosing which app to target: the deploy that follows always republishes over the app named by `EDGE_APP_ID`, never a new one. If you're publishing through a tool that manages `EDGE_APP_ID` on your behalf (for example, an integration that remembers an id per name), a "new" name no longer produces a new Edge App while the environment variable is set; it republishes over the existing one and updates its own bookkeeping to match.

#### Entrypoint

The `entrypoint` field specifies the entry point for the Edge App. It is optional and defaults to the file type. The `entrypoint` field contains the following subfields:
Expand Down
29 changes: 19 additions & 10 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use thiserror::Error;

use crate::authentication::{verify_and_store_token, Authentication, AuthenticationError, Config};
use crate::commands;
use crate::commands::edge_app::app::app_id_override;
use crate::commands::edge_app::instance_manifest::InstanceManifest;
use crate::commands::edge_app::manifest::EdgeAppManifest;
use crate::commands::edge_app::server::MOCK_DATA_FILENAME;
Expand Down Expand Up @@ -923,7 +924,7 @@ pub fn handle_cli_edge_app_command(command: &EdgeAppCommands, output: OutputForm
EdgeAppCommands::Deploy {
path,
delete_missing_settings,
} => match edge_app_command.deploy(path.clone(), *delete_missing_settings) {
} => match edge_app_command.deploy(None, path.clone(), *delete_missing_settings) {
Ok(revision) => {
println!("Edge App successfully deployed. Revision: {revision}.");
}
Expand All @@ -940,7 +941,12 @@ pub fn handle_cli_edge_app_command(command: &EdgeAppCommands, output: OutputForm
);
}
EdgeAppSettingsCommands::Set { setting_pair, path } => {
match edge_app_command.set_setting(path.clone(), &setting_pair.0, &setting_pair.1) {
match edge_app_command.set_setting(
None,
path.clone(),
&setting_pair.0,
&setting_pair.1,
) {
Ok(()) => {
println!("Edge App setting successfully set.");
}
Expand Down Expand Up @@ -986,15 +992,18 @@ pub fn handle_cli_edge_app_command(command: &EdgeAppCommands, output: OutputForm
}
};

// If the user didn't specify an app id, we need to clear it from the manifest
match edge_app_command.clear_app_id(manifest_path.as_path()) {
Ok(()) => {
println!("App id cleared from manifest.");
}
Err(e) => {
error!("Error occurred while clearing manifest: {e}");
std::process::exit(1);
if app_id_override().is_none() {
match edge_app_command.clear_app_id(manifest_path.as_path()) {
Ok(()) => {
println!("App id cleared from manifest.");
}
Err(e) => {
error!("Error occurred while clearing manifest: {e}");
std::process::exit(1);
}
}
} else {
println!("Skipping manifest cleanup: the deleted app's id came from the EDGE_APP_ID environment variable, not the manifest.");
}
std::process::exit(0);
}
Expand Down
Loading
Loading