Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore(generate.yml): add environment variables for Spacelift API key to create-action-repo job chore(generate.yml): remove TF_VAR_BOT_TOKEN environment variable from plan and apply steps chore(main.tf): update terraform backend configuration to use remote backend on spacelift.io for the liquibase organization and workspace "liquibase-github-actions" * chore(main.tf): remove unused backend configuration in terraform block * chore(main.tf): add remote backend configuration for Terraform to use Spacelift.io as the backend feat(main.tf): configure Terraform to use the "liquibase-github-actions" workspace in the "liquibase" organization on Spacelift.io as the backend * chore(generate.yml): remove unnecessary Terraform setup step The Terraform setup step was removed because it is not needed for the current workflow. * chore(generate.yml): update environment variable names for Spacelift API key fix(generate.yml): add -lock=false flag to terraform plan and terraform apply commands to prevent locking the state file during execution * chore(generate.yml): add environment variable TF_VAR_BOT_TOKEN to provide the admin token for the generator action repository chore(generate.yml): add environment variable TF_TOKEN_spacelift_io to provide the Spacelift API key for the generator action repository * chore(main.tf): remove unused backend configuration in terraform file * chore(main.tf): add remote backend configuration for Terraform to use Spacelift.io as the backend feat(main.tf): configure Terraform to use the "liquibase-github-actions" workspace in the "liquibase" organization on Spacelift.io as the backend * fix(generate.yml): remove unnecessary -lock=false flag from terraform apply command The -lock=false flag is not necessary for the terraform apply command. Removing it improves the readability of the command and avoids confusion. * fix(generate.yml): add -lock=false flag to terraform apply command to prevent locking the state file during apply feat(generate.yml): add Terraform State Push step to push errored.tfstate file to remote state backend, even if previous steps failed * fix(generate.yml): update Terraform State Push step to disable locking to prevent errors during state push * fix(generate.yml): add -force flag to terraform state push command to force push the errored.tfstate file * fix(generate.yml): add cat command to print contents of errored.tfstate before pushing state to Terraform backend The `generate.yml` workflow file was modified to add a `cat` command before pushing the state to the Terraform backend. This change was made to print the contents of the `errored.tfstate` file for debugging purposes. * fix(generate.yml): increment serial number and update terraform version in errored.tfstate file The `generate.yml` workflow file was updated to fix an issue with the `Terraform State Push` step. The following changes were made: - Added a command to display the contents of the `errored.tfstate` file. - Added variables `STATE_FILE`, `current_serial`, and `new_serial` to store the current and new serial numbers. - Incremented the current serial number by 1 and stored it in `new_serial`. - Updated the `errored.tfstate` file by using `jq` to add the new serial number and update the terraform version. - Added a command to display the contents of the updated `errored.tfstate` file. - Updated the `terraform state push` command to use the updated `errored.tfstate` file with the lock disabled and force enabled. * chore(main.tf): add required_version to terraform block to enforce a specific version of Terraform (1.5.7) chore(main.tf): update backend hostname and organization to match new spacelift.io configuration * downgrade terraform version for spacelift * chore(generate.yml): comment out unused steps in the workflow file The unused steps in the generate.yml workflow file have been commented out to improve readability and prevent unnecessary execution of those steps. * chore(generate.yml): update hashicorp/setup-terraform action to version 3 to ensure compatibility with the latest features and improvements chore(generate.yml): remove unused cli_config_credentials_token parameter from hashicorp/setup-terraform action * chore(main.tf): remove unused backend configuration for remote state management chore(main.tf): remove unnecessary workspace configuration for remote state management * chore(main.tf): add remote backend configuration for Terraform state management to store state in spacelift.io organization and workspace "liquibase-github-actions" feat(main.tf): update github_repository resource to use for_each to create multiple repositories based on local.commands, and improve resource configuration formatting for better readability * chore(main.tf): remove unused backend configuration to simplify the Terraform configuration fix(main.tf): update the owner of the GitHub provider to "liquibase" to match the correct organization refactor(main.tf): remove unused resource "github_repository" to clean up the Terraform configuration * chore(main.tf): update provider owner from "liquibase" to "liquibase-github-actions" for better clarity and accuracy feat(main.tf): add resource block to create GitHub repositories based on commands defined in commands.json file, with appropriate naming and descriptions * chore(.gitignore): remove unused 'commands.json' file from being tracked by git feat(commands.json): add 'commands.json' file containing a list of available commands for the application * chore(main.tf): update commands list in locals to include all available commands The commands list in locals was updated to include all available commands for the Liquibase GitHub Actions. This ensures that all commands are accounted for and can be used in the Terraform configuration. * chore(main.tf): refactor commands variable to use double quotes for consistency and readability * chore(.gitignore): add commands.json to the list of ignored files feat(main.tf): add remote backend configuration for Terraform to store state in spacelift.io organization workspace "liquibase-github-actions" refactor(main.tf): replace hardcoded commands list with reading commands from commands.json file * fix(generate.yml): add -lock=false flag to the terraform plan command to disable locking and prevent potential issues with concurrent runs * chore(generate.yml): uncomment Terraform Apply and Terraform State Push steps chore(generate.yml): uncomment generate-action and output-action steps The Terraform Apply and Terraform State Push steps were uncommented to enable the execution of Terraform apply and state push commands. This is necessary for the deployment and management of infrastructure resources. The generate-action and output-action steps were also uncommented to enable the generation of commands and the output of the action edit link. These steps are crucial for the overall workflow and automation process. * chore(generate.yml): remove Terraform State Push step from the workflow The Terraform State Push step was removed from the workflow as it was causing errors and is no longer needed. * chore(generate.yml): remove trailing whitespace to improve code readability * chore(terraform): add .terraform.lock.hcl file to track provider version and constraints A new file `.terraform.lock.hcl` has been added to the repository. This file is automatically maintained by `terraform init` command and should not be manually edited. It tracks the version and constraints of the provider `registry.terraform.io/integrations/github`. The current version is `4.31.0` and the constraints are set to `~> 4.0`. The file includes a list of hashes for the provider's artifacts to ensure integrity and security. * chore(.terraform.lock.hcl): add newline at the end of the file for consistency and to adhere to best practices * fix(generate.yml): add `-reconfigure` flag to `terraform init` command to ensure proper initialization of the Terraform workspace feat(generate.yml): add steps to pull and push the current state file to/from the Terraform backend to ensure consistency and synchronization * fix(generate.yml): add -lock=false flag to the terraform state push command to disable locking when pushing state * fix(generate.yml): change output file name from current_state.tfstate to current.tfstate in the Terraform Pull state step fix(generate.yml): add terraform init -force-copy -backend=false command in the Terraform Pull state step to ensure a clean initialization fix(generate.yml): add terraform init -reconfigure command in the Terraform Push state step to reconfigure the backend before pushing the state fix(generate.yml): change output file name from current_state.tfstate to current.tfstate in the Terraform Push state step * chore(generate.yml): update workflow to install spacectl instead of terraform and add support for local preview of infrastructure changes chore(main.tf): remove backend configuration for remote state as it is no longer needed with the switch to spacectl * fix(generate.yml): update spacectl command to use 'preview' instead of 'local-preview' for consistency with other commands * chore(generate.yml): comment out unused workflow steps to improve readability and reduce noise in the file * fix(generate.yml): change 'spacectl stack preview' command to 'spacectl stack local-preview' to run the stack locally instead of in the cloud * fix(main.tf): fix file path for commands.json to be relative to the current directory instead of the module directory * chore(generate.yml): add ls -ltr command before running spacectl stack local-preview to debug the issue fix(main.tf): fix the path to commands.json file to use the module path for better reliability * chore(.gitignore): remove unused "commands.json" file from git tracking * chore(generate.yml): remove commands.json from .gitignore to allow uploading the file to Spacelift chore(generate.yml): update comment to explain the reason for removing commands.json from .gitignore chore(gitignore): remove newline at end of file * chore(generate.yml): uncomment deploy infrastructure step to enable deployment of infrastructure chore(generate.yml): uncomment generate-action and output-action steps to enable generation and output of action * chore(generate.yml): remove commands.json from .gitignore to allow uploading it to Spacelift fix(generate.yml): update spacectl commands to include necessary flags for local preview and deployment * fix(generate.yml): add condition to deploy infrastructure and generate action jobs to only run on the main branch * fix(generate.yml): update spacectl stack deploy command to include setting current commit before deployment The previous command only deployed the stack without setting the current commit. This caused issues with tracking the deployed version. The updated command now sets the current commit to the latest commit SHA before deploying the stack. * chore(generate.yml): add workflow step to check for changes in commands.json file feat(generate.yml): add workflow step to commit and push changes in commands.json file if changes are found fix(generate.yml): remove unnecessary --commit flag from spacectl stack set-current-commit command * chore(generate.yml): update git command to add commands.json file forcefully to the commit fix(generate.yml): update commit message to indicate changes in commands.json file * Update commands.json * chore(.gitignore): add .terraform.lock.hcl to the list of ignored files to prevent it from being tracked by git * chore(generate.yml): remove unnecessary step to check for changes in commands.json fix(generate.yml): allow commit and push step to continue even if there are errors to prevent workflow failure --------- Co-authored-by: liquibot <[email protected]>
- Loading branch information