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

Update docs for v2.4: Roadmap, new Schema to CLI generation, Ansible plugin #407

Merged
merged 12 commits into from
Feb 20, 2023

Conversation

arm4b
Copy link
Member

@arm4b arm4b commented Feb 17, 2023

Update documentation following the #403 and bitops-plugins/ansible#11

  • v2.4 release page update
  • Ansible plugin schema
  • Schema to CLI configuration example
  • Magic ENV variables defaulting

@arm4b arm4b added the documentation 📗 Improvements or additions to documentation label Feb 17, 2023
@arm4b arm4b added this to the v2.4.0 milestone Feb 17, 2023
@runforesight
Copy link

runforesight bot commented Feb 17, 2023

Foresight Summary

    
Major Impacts
Foresight hasn't detected any major impact on your workflows and tests.

View More Details

✅  CI workflow has finished in 26 seconds and finished at 20th Feb, 2023.


Job Failed Steps Tests
lint-black -     🔗  N/A See Details
lint-pylint -     🔗  N/A See Details

🔎 See details on Foresight

*You can configure Foresight comments in your organization settings page.

@arm4b arm4b changed the title WIP: Update docs for new Schema to CLI generation and Ansible refactoring WIP: Update docs for v2.4: Roadmap, new Schema to CLI generation, Ansible plugin Feb 17, 2023

# Ansible

### Example `bitops.config.yaml`, minimum required:
```
```yaml
ansible:
cli: {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something seems wrong with this schema..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anything specific that's wrong in this schema?

That's the empty schema example we allow for any plugin.
Here is from Terraform: https://bitops.sh/tool-configuration/configuration-terraform/#example-bitopsconfigyaml-minimum-required

Maybe it's good to make it even smaller for a quick start defaults like

ansible: {}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is my apologies. I just noticed the below YAML isn't a continuation it's a different block entirely.

Comment on lines 20 to 23
## Magic Environemnt Variables
Plugin environment variables are automatically mapped to the `bitops.config.yaml` keys. This means that you can use the same environment variable names as in the plugin config. For example, if you want to override the `ansible.cli.skip-tags` value, you can use the `BITOPS_ANSIBLE_SKIP_TAGS` environment variable. In this case, `BITOPS` is the prefix, `ANSIBLE` is the plugin name, and `SKIP_TAGS` is the key name (note hypens are replaced with underscores).

The precedence order is: `ENV` vars > `bitops.config.yaml` values > `bitops.config.schema.yaml` defaults. This way, ENV variables specified by user are taking highest precedence over config values and defaults. We recommend using them dynamically in CI/CD pipelines to control the deployment based on condition (PR run, branch, etc) or manually passing to the the BitOps docker container.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking for feedback on this ^^

Is there any better naming for the Magic Environment Variables?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated with Environment Variables Defaulting per @PhillypHenning

@arm4b arm4b marked this pull request as ready for review February 20, 2023 21:50
@arm4b arm4b changed the title WIP: Update docs for v2.4: Roadmap, new Schema to CLI generation, Ansible plugin Update docs for v2.4: Roadmap, new Schema to CLI generation, Ansible plugin Feb 20, 2023
Comment on lines 23 to 43
# CLI properties will composed into a CLI string and exported as "${BITOPS_MY_PLUGIN_CLI}"
cli:
type: object
properties:
# positional argument, if no `parameter` set
# ex: "run"
command:
type: string
default: run
required: true
# cli argument
# ex: "--key=value"
key:
parameter: key
type: string
# boolean flag, set if value is `true`
# ex: "--bar"
bar:
parameter: bar
type: boolean
default: true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New schema to CLI example

@arm4b arm4b merged commit cefdba3 into main Feb 20, 2023
@arm4b arm4b deleted the 2.4-docs branch February 20, 2023 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation 📗 Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants