mirror of
https://github.com/imjasonh/krust
synced 2026-07-08 06:45:32 +00:00
support building --example and --bin
Signed-off-by: Jason Hall <jason@chainguard.dev>
This commit is contained in:
parent
8fcd3de473
commit
4a2471c22d
3 changed files with 66 additions and 4 deletions
26
tests/testdata/build_example.txt
vendored
Normal file
26
tests/testdata/build_example.txt
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# Test building examples with --example flag
|
||||
|
||||
-- Cargo.toml --
|
||||
[package]
|
||||
name = "test-app"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
-- src/main.rs --
|
||||
fn main() {
|
||||
println!("Hello from main!");
|
||||
}
|
||||
|
||||
-- examples/example_server.rs --
|
||||
fn main() {
|
||||
println!("Hello from example!");
|
||||
}
|
||||
|
||||
# Build the example binary
|
||||
[linux] env KRUST_REPO=ttl.sh/test exec ./krust build --no-push --platform linux/amd64 . -- --example example_server
|
||||
[darwin] env KRUST_REPO=ttl.sh/test exec ./krust build --no-push --platform linux/amd64 . -- --example example_server
|
||||
stderr 'Building Rust project'
|
||||
stderr 'Successfully built binary'
|
||||
stderr 'examples/example_server'
|
||||
stderr 'Successfully built image'
|
||||
Loading…
Add table
Add a link
Reference in a new issue