-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/service scaffolding #4
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
Conversation
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 commit introduces two main features:
1. **`sailr add service <service_name> --type <app_type>` command:**
* Generates basic Kubernetes manifest templates (Deployment, Service, ConfigMap) in `k8s/templates/<service_name>/`.
* Adds a corresponding service entry to the `config.toml` of the "develop" environment (future improvement: make environment configurable).
* Supports different application archetypes via the `--type` flag (currently basic, can be expanded).
2. **Enhanced `sailr init <env_name>` command:**
* Optionally creates a default "sample-app" service upon environment initialization.
* Generates templates for "sample-app" in `k8s/templates/sample-app/`.
* Adds an entry for "sample-app" to the new environment's `config.toml`.
* This makes the environment runnable and demonstratable immediately.
Includes:
* New CLI arguments and command handling logic.
* Template generation functions in `src/templates/scaffolding.rs`.
* Modifications to `config.toml` management in `src/environment.rs`.
* Integration tests for both `add service` and the enhanced `init` command, ensuring file creation and configuration updates are correct.
This commit updates the documentation to reflect the new `sailr add service`
command and the enhancements to the `sailr init` command.
Changes include:
* **`docs/docs/cli-usage.md`**:
* Added a new section for `sailr add service`, detailing its usage,
arguments (`<service_name>`, `--type`), and actions (template
generation, config update).
* Updated the `sailr init` section to include information about the
automatic creation of the "sample-app" service.
* **`README.md`**:
* Briefly updated the `sailr init` description.
* Added a short description for the new `sailr add service` command
in the CLI usage overview.
* Enhanced links to the more detailed CLI command reference in
`docs/docs/cli-usage.md`.
This commit introduces service scaffolding capabilities and enhances the
`sailr init` command.
Features:
1. **`sailr add service <service_name> --type <app_type>` command:**
* Generates Kubernetes manifest templates (Deployment, Service,
ConfigMap) in `k8s/templates/<service_name>/`.
* Adds a corresponding service entry to the `config.toml` of
the "develop" environment.
* The `--type` flag can be used for different application archetypes.
2. **Enhanced `sailr init <env_name>` command:**
* Creates a default "sample-app" service upon environment
initialization, including templates and `config.toml` entry.
* This makes the environment immediately runnable and demonstratable.
Fixes:
* Corrects build errors related to `Service` struct instantiation in
`src/main.rs` by aligning with the struct's actual definition in
`src/environment.rs`. Non-existent fields are no longer referenced,
and types for existing fields are now correct.
Documentation:
* Updates `docs/docs/cli-usage.md` and `README.md` to reflect the new
`add service` command and the enhancements to `init`.
Includes:
* New CLI arguments and command handling logic.
* Template generation functions in `src/templates/scaffolding.rs`.
* Modifications to `config.toml` management.
* Integration tests for `add service` and enhanced `init` commands.
This commit introduces service scaffolding capabilities, enhances the
`sailr init` command, and includes fixes for build and test errors.
Features:
1. **`sailr add service <service_name> --type <app_type>` command:**
* Generates Kubernetes manifest templates (Deployment, Service,
ConfigMap) in `k8s/templates/<service_name>/`.
* Adds a corresponding service entry to the `config.toml` of
the "develop" environment.
* The `--type` flag can be used for different application archetypes.
2. **Enhanced `sailr init <env_name>` command:**
* Creates a default "sample-app" service upon environment
initialization, including templates and `config.toml` entry.
Fixes:
* **`src/main.rs`**: Corrects build errors related to `Service` struct
instantiation by aligning with the struct's actual definition.
* **`tests/cli_integration_tests.rs`**:
* Corrects `Service` struct instantiations to align with definition.
* Fixes arguments for `Environment::load_from_file` calls to use
`&String` instead of `&PathBuf`.
* Removes unused imports (`Cli` and `std::io::Write`).
* Ensures `AddServiceArgs` instantiation matches the current
`src/cli.rs` (which does not include an `env_name` field).
Documentation:
* Updates `docs/docs/cli-usage.md` and `README.md` to reflect the new
`add service` command and the enhancements to `init`.
Includes:
* New CLI arguments and command handling logic.
* Template generation functions in `src/templates/scaffolding.rs`.
* Modifications to `config.toml` management.
* Integration tests for `add service` and enhanced `init` commands.
This commit updates the `sailr init` command to only provision
infrastructure when a provider is explicitly specified. It also
consolidates all previous features and fixes related to service
scaffolding.
Changes:
* **`src/main.rs`**:
* Modified `Commands::Init` handler: Infrastructure provisioning
(e.g., for LocalK8) is now skipped if no `--provider` or
`--infra-template-path` is given. A log message is added to
inform you.
* Corrected `Service` struct instantiation in `Commands::AddService`
and `Commands::Init` (for sample-app) to align with its definition.
* **`tests/cli_integration_tests.rs`**:
* Corrected `Service` struct instantiations.
* Fixed `Environment::load_from_file` arguments.
* Removed unused imports.
* Test for `init` implicitly verified against new behavior as it
was already testing the no-provider scenario for infra.
* **Features (from previous commits in this series)**:
* `sailr add service <name> --type <type>` command for scaffolding.
* `sailr init` now creates a "sample-app" by default.
* **Documentation (from previous commits in this series)**:
* Updated `docs/docs/cli-usage.md` and `README.md` for new CLI
features and behaviors.
This commit ensures the `init` command behaves as per recent feedback from you and integrates all developed functionalities and fixes into
a single, coherent state.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.