The Readme.md files reference the data directory and .sample files, but the code did not allow for their populating. This update enables the copying of the data directory and .sample files, with the data directory being populating as a data.sample directory to prevent overwriting any existing data directory.
Additionally, dependencies have been updated by adding the depends_on section to several resources to ensure that the dependencies are in the correct order. This update addresses some states that were not being handled previously.
There is a minor known issue with Pull Request creation in the current state of the code. The Pull Request is only created after the first run has occurred. A fix for this issue is currently being worked on and will be addressed in a separate Pull Request. However, this issue does not affect the main functionality of the code.
* feat: Add Pull Request support to 0-cicd-github
The cloud-foundation-fabricrepository is continually evolving, and to help keep up with the changes, it would be beneficial to introduce a pull request mechanism to review and approve changes. This feature is 100% backward compatible, and by default, no pull request is created, and changes are committed directly to the main branch. However, an optional variable pull_request_config can be used to configure the title, body, head_ref, and base_ref of the pull request that will be created for the initial population or update of files. To create a pull request, in pull_request_config set the create attribute to true. base_ref defaults to main, and head_ref to the name of the head branch. If the head branch doesn't exist, it will be created from the base_ref branch.
* fix README.md
* fix pull_request_config title
When running 0-cicd-github multiple times, files that haven't changed are also committed. This change adds an option to skip committing unchanged files to prevent unnecessary commits.
Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
* Fix Terraform formatting and add module/ prefix to path in 0-cicd-github repository population
fix the formatting of Terraform files and adds the module/ prefix to the module path in 0-cicd-github under repository population. Without proper formatting and module path, generated repositories may show formatting mismatches and examples in the README.md file may not run as expected.
The changes include updating the replace function with a new regular expression pattern to correctly apply the git source for modules and updating the each.value.file attribute to include the module/ prefix in the Terraform file path. This ensures that the examples in the README.md file work as intended and that the generated repositories follow best practices for Terraform code.
* revert modules/ prefix change
* Add module_prefix to modules_config
- Add module_prefix to modules_config
- Add example to Readme.md
- use module_prefix variable to specify the path
* fix tfdoc
* add clone commands output
* always create secret key for repos, fix module source
* optional modules ref
* tfdoc
* create secrets in the right repositories
* add publick key to modules repository
* bump Terraform version in CI templates
* add template to populated files
* tfdoc
* do not error out writing ci/cd workflows when output files are disabled
* update README
* fix apply file outputs when outputs_location is changed to null