-
Notifications
You must be signed in to change notification settings - Fork 5.6k
feat(unstable): deploy subcommand #29407
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
83cd0de
feat: deploy subcommand
crowlKats 1c8db02
clean
crowlKats 1461910
fmt
crowlKats 882a710
Merge branch 'main' into deploy-subcommand
crowlKats b0fa463
enable subcommand only behind env var
crowlKats 92191ed
add repo link
crowlKats 59828e4
use DENO_DEPLOY_SUBCOMMAND for endpoint
crowlKats 40d4e23
fmt
crowlKats d73401d
fmt
crowlKats File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright 2018-2025 the Deno authors. MIT license. | ||
|
||
use std::sync::Arc; | ||
|
||
use deno_core::error::AnyError; | ||
use deno_lib::worker::LibWorkerFactoryRoots; | ||
use deno_runtime::WorkerExecutionMode; | ||
|
||
use crate::args::jsr_api_url; | ||
use crate::args::DenoSubcommand; | ||
use crate::args::Flags; | ||
use crate::args::RunFlags; | ||
use crate::factory::CliFactory; | ||
use crate::registry; | ||
use crate::tools; | ||
|
||
pub async fn deploy( | ||
flags: Arc<Flags>, | ||
roots: LibWorkerFactoryRoots, | ||
) -> Result<i32, AnyError> { | ||
let cli_factory = CliFactory::from_flags(flags.clone()); | ||
let client = cli_factory.http_client_provider().get_or_create()?; | ||
let registry_api_url = jsr_api_url(); | ||
|
||
let response = | ||
registry::get_package(&client, registry_api_url, "deno", "deploy").await?; | ||
let res = registry::parse_response::<registry::Package>(response).await?; | ||
|
||
let mut flags = Arc::unwrap_or_clone(flags); | ||
flags.subcommand = DenoSubcommand::Run(RunFlags { | ||
script: format!( | ||
"jsr:@deno/deploy@{}", | ||
bartlomieju marked this conversation as resolved.
Show resolved
Hide resolved
crowlKats marked this conversation as resolved.
Show resolved
Hide resolved
|
||
res | ||
.latest_version | ||
.expect("expected @deno/deploy to be published") | ||
), | ||
watch: None, | ||
bare: false, | ||
}); | ||
|
||
tools::run::run_script( | ||
WorkerExecutionMode::Run, | ||
Arc::new(flags), | ||
None, | ||
None, | ||
roots, | ||
) | ||
.await | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.