-
-
Notifications
You must be signed in to change notification settings - Fork 1
Added option to allow the user the option of not using crate2nix but the default Docker build process instead. #560
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,29 @@ | ||
| # If tilt_options.json exists read it and load the default_registry value from it | ||
| # If tilt_options.json exists read it | ||
| settings = read_json('tilt_options.json', default={}) | ||
| registry = settings.get('default_registry', 'oci.stackable.tech/sandbox') | ||
|
|
||
| # Configure default registry either read from config file above, or with default value of "oci.stackable.tech/sandbox" | ||
| default_registry(registry) | ||
|
|
||
| # Configure which builder to use from config file, defaults to 'crate2nix' | ||
| builder = settings.get('builder', 'crate2nix') | ||
|
|
||
| meta = read_json('nix/meta.json') | ||
| operator_name = meta['operator']['name'] | ||
|
|
||
| custom_build( | ||
| registry + '/' + operator_name, | ||
| 'make regenerate-nix && nix-build . -A docker --argstr dockerName "${EXPECTED_REGISTRY}/' + operator_name + '" && ./result/load-image | docker load', | ||
| deps=['rust', 'Cargo.toml', 'Cargo.lock', 'default.nix', "nix", 'build.rs', 'vendor'], | ||
| ignore=['*.~undo-tree~'], | ||
| # ignore=['result*', 'Cargo.nix', 'target', *.yaml], | ||
| outputs_image_ref_to='result/ref', | ||
| ) | ||
| if builder == 'crate2nix': | ||
soenkeliebau marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| custom_build( | ||
| registry + '/' + operator_name, | ||
| 'make regenerate-nix && nix-build . -A docker --argstr dockerName "${EXPECTED_REGISTRY}/' + operator_name + '" && ./result/load-image | docker load', | ||
| deps=['rust', 'Cargo.toml', 'Cargo.lock', 'default.nix', "nix", 'build.rs', 'vendor'], | ||
| ignore=['*.~undo-tree~'], | ||
| # ignore=['result*', 'Cargo.nix', 'target', *.yaml], | ||
| outputs_image_ref_to='result/ref', | ||
| ) | ||
| else if builder == 'docker': | ||
| docker_build(registry + '/' + operator_name, '.', dockerfile='docker/Dockerfile') | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this also need
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't look like docker_build supports that: https://docs.tilt.dev/api.html#api.docker_build Not sure how it would know when to rebuild though ...
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The docker_build supports live update functionality, which I think would allow us to copy the compiled binary into the running container .. not sure how the restart would then happen though ... https://github.com/tilt-dev/live_update/blob/master/go/Tiltfile |
||
| else: | ||
| fail('Unsupported builder specified: [' + builder + '] - currently supported builders are: [docker, crate2nix]') | ||
soenkeliebau marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Load the latest CRDs from Nix | ||
| watch_file('result') | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.