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

spin up --build --help incorrectly builds the application #2323

Closed
endocrimes opened this issue Mar 5, 2024 · 0 comments · Fixed by #2324
Closed

spin up --build --help incorrectly builds the application #2323

endocrimes opened this issue Mar 5, 2024 · 0 comments · Fixed by #2324
Labels
area/CLI CLI bug Something isn't working

Comments

@endocrimes
Copy link
Member

When passing both --build and --help to spin up, the application builds while also showing help output - you can see this in the details block below. One would expect the application to not build, but instead only show the help output 😅 (although admittedly this is an amusing issue to write).

$ spin up --build --help
$ spin up --build --help
spin-up 
Start the Spin application

USAGE:
    spin up [OPTIONS]

OPTIONS:
        --build                 For local apps, specifies to perform `spin build` before running the
                                application [env: SPIN_ALWAYS_BUILD=]
        --direct-mounts         For local apps with directory mounts and no excluded files, mount
                                them directly instead of using a temporary directory
    -e, --env <ENV>             Pass an environment variable (key=value) to all components of the
                                application
    -f, --from <APPLICATION>    The application to run. This may be a manifest (spin.toml) file, a
                                directory containing a spin.toml file, or a remote registry
                                reference. If omitted, it defaults to "spin.toml"
    -h, --help                  
    -k, --insecure              Ignore server certificate errors from a registry
        --temp <TMP>            Temporary directory for the static assets of the components

Building component hello-starling with `npm run build`

> [email protected] build
> npx webpack --mode=production && npx mkdirp target && ./tools/componentize.sh ./dist/spin.js ./target/hello-starling.wasm

asset spin.js 3.53 KiB [compared for emit] (name: main)
./src/index.ts 3 KiB [built] [code generated]
webpack 5.90.3 compiled successfully in 628 ms
Finished building all Spin components
HTTP TRIGGER OPTIONS:
        --allow-transient-write
            Set the static assets of the components in the temporary directory as writable

        --cache <WASMTIME_CACHE_FILE>
            Wasmtime cache configuration file
            
            [env: WASMTIME_CACHE_FILE=]

        --disable-cache
            Disable Wasmtime cache
            
            [env: DISABLE_WASMTIME_CACHE=]

        --disable-pooling
            Disable Wasmtime's pooling instance allocator

        --follow <FOLLOW_ID>
            Print output to stdout/stderr only for given component(s)

        --key-value <KEY_VALUES>
            Set a key/value pair (key=value) in the application's default store. Any existing value
            will be overwritten. Can be used multiple times

    -L, --log-dir <APP_LOG_DIR>
            Log directory for the stdout and stderr of components. Setting to the empty string
            disables logging to disk
            
            [env: SPIN_LOG_DIR=]

        --listen <ADDRESS>
            IP address and port to listen on
            
            [default: 127.0.0.1:3000]

    -q, --quiet
            Silence all component output to stdout/stderr

        --runtime-config-file <RUNTIME_CONFIG_FILE>
            Configuration file for config providers and wasmtime config
            
            [env: RUNTIME_CONFIG_FILE=]

        --sqlite <SQLITE_STATEMENTS>
            Run a SQLite statement such as a migration against the default database. To run from a
            file, prefix the filename with @ e.g. spin up --sqlite @migration.sql

        --state-dir <STATE_DIR>
            Set the application state directory path. This is used in the default locations for
            logs, key value stores, etc.
            
            For local apps, this defaults to `.spin/` relative to the `spin.toml` file. For remote
            apps, this has no default (unset). Passing an empty value forces the value to be unset.

        --tls-cert <TLS_CERT>
            The path to the certificate to use for https, if this is not set, normal http will be
            used. The cert should be in PEM format
            
            [env: SPIN_TLS_CERT=]

        --tls-key <TLS_KEY>
            The path to the certificate key to use for https, if this is not set, normal http will
            be used. The key should be in PKCS#8 format
            
            [env: SPIN_TLS_KEY=]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/CLI CLI bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant