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

DAT-16244 Minor fixes #106

Merged
merged 60 commits into from
Jan 5, 2024
Merged

DAT-16244 Minor fixes #106

merged 60 commits into from
Jan 5, 2024

Conversation

jandroav
Copy link
Contributor

@jandroav jandroav commented Jan 5, 2024

No description provided.

jandroav and others added 30 commits January 3, 2024 14:00
…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"
… 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
The Terraform setup step was removed because it is not needed for the current workflow.
…API key

fix(generate.yml): add -lock=false flag to terraform plan and terraform apply commands to prevent locking the state file during execution
…vide 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
DAT-16244
DevOps :: Spacelift replacement of Terraform Cloud
… 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
… 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.
… 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
…te 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.
…on 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.
…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
The unused steps in the generate.yml workflow file have been commented out to improve readability and prevent unnecessary execution of those steps.
…on 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
…management

chore(main.tf): remove unnecessary workspace configuration for remote state management
…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
…erraform 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
…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
…ked by git

feat(commands.json): add 'commands.json' file containing a list of available commands for the application
…le 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.
jandroav and others added 27 commits January 4, 2024 18:40
…sh 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.
The Terraform State Push step was removed from the workflow as it was causing errors and is no longer needed.
…ion 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.
…d 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
…ommand to disable locking when pushing state
… 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
…erraform 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
…f 'local-preview' for consistency with other commands
…tl stack local-preview' to run the stack locally instead of in the cloud
…urrent directory instead of the module directory
…k local-preview to debug the issue

fix(main.tf): fix the path to commands.json file to use the module path for better reliability
…loading 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
…eployment of infrastructure

chore(generate.yml): uncomment generate-action and output-action steps to enable generation and output of action
…loading it to Spacelift

fix(generate.yml): update spacectl commands to include necessary flags for local preview and deployment
…e action jobs to only run on the main branch
…tting 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.
…ds.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
…cefully to the commit

fix(generate.yml): update commit message to indicate changes in commands.json file
…es to prevent it from being tracked by git
…commands.json

fix(generate.yml): allow commit and push step to continue even if there are errors to prevent workflow failure
@jandroav jandroav merged commit 1890150 into main Jan 5, 2024
5 checks passed
@jandroav jandroav deleted the DAT-16244 branch January 5, 2024 09:21
@jandroav jandroav restored the DAT-16244 branch January 5, 2024 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants