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

chores: exec db bootstrap in action #66

Merged
merged 35 commits into from
Nov 14, 2024

Conversation

andreasisnes
Copy link
Collaborator

Run ts in Bootstrap action

  • modified TF apply template to write output to given file. defaults to "tf_output.json"
  • bootstrap-db.mts can read specific outputs values from "tf_output.json"
  • add gh environment variable GATEWAY_API_URL
  • add database config to "config.json"

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

@andreasisnes andreasisnes force-pushed the chores/run-bootstrap-in-action branch from c474f83 to 1aeefbb Compare November 14, 2024 09:05
@andreasisnes andreasisnes merged commit 560f38f into main Nov 14, 2024
10 checks passed
@andreasisnes andreasisnes deleted the chores/run-bootstrap-in-action branch November 14, 2024 09:21
Copy link

github-actions bot commented Nov 14, 2024

Terraform environment at22

Format and Style 🖌success

Initialization ⚙️success

Validation 🤖success

Validation Output

Success! The configuration is valid.


Plan 📖success

Show Plan

[Lines containing Refreshing state removed]
[Maybe further truncated see logs for complete plan output]
Acquiring state lock. This may take a few moments...
module.app.data.azurerm_key_vault.kv: Reading...
module.app.data.azurerm_app_configuration.appconf: Reading...
module.app.data.azurerm_container_app_environment.caenv: Reading...
data.azurerm_user_assigned_identity.application_admin: Reading...
module.app.data.azurerm_servicebus_namespace.sb: Reading...
data.azurerm_user_assigned_identity.application_admin: Read complete after 1s [id=/subscriptions/37bac63a-b964-46b2-8de8-ba93c432ea1f/resourceGroups/rgauth001at22/providers/Microsoft.ManagedIdentity/userAssignedIdentities/miappadminauth001at22]
module.app.data.azurerm_key_vault.kv: Read complete after 2s [id=/subscriptions/37bac63a-b964-46b2-8de8-ba93c432ea1f/resourceGroups/rgauth001at22/providers/Microsoft.KeyVault/vaults/kvaltinnauth001at22]
module.app.data.azurerm_container_app_environment.caenv: Read complete after 3s [id=/subscriptions/37bac63a-b964-46b2-8de8-ba93c432ea1f/resourceGroups/rgauth001at22/providers/Microsoft.App/managedEnvironments/caenvauth001at22]
module.app.data.azurerm_servicebus_namespace.sb: Read complete after 3s [id=/subscriptions/37bac63a-b964-46b2-8de8-ba93c432ea1f/resourceGroups/rgauth001at22/providers/Microsoft.ServiceBus/namespaces/sbaltinnauth001at22]
module.app.data.azurerm_app_configuration.appconf: Read complete after 3s [id=/subscriptions/37bac63a-b964-46b2-8de8-ba93c432ea1f/resourceGroups/rgauth001at22/providers/Microsoft.AppConfiguration/configurationStores/appconfaltinnauth001at22]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # module.app.azurerm_container_app.app will be updated in-place
  ~ resource "azurerm_container_app" "app" {
        id                            = "/subscriptions/37bac63a-b964-46b2-8de8-ba93c432ea1f/resourceGroups/rgdeployapi001at22/providers/Microsoft.App/containerApps/cadeployapi001at22"
        name                          = "cadeployapi001at22"
        tags                          = {}
        # (9 unchanged attributes hidden)

      ~ template {
            # (2 unchanged attributes hidden)

          ~ container {
              ~ image             = "ghcr.io/altinn/altinn-authorization-tmp/altinn-authorization-deployapi:78f46c9" -> "ghcr.io/altinn/altinn-authorization-tmp/altinn-authorization-deployapi:560f38f"
                name              = "deployapi"
                # (5 unchanged attributes hidden)

                # (3 unchanged blocks hidden)
            }
        }

        # (2 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: tfplan.out

To perform exactly these actions, run the following command to apply:
    terraform apply "tfplan.out"
Releasing state lock. This may take a few moments...

Context Values
Pusher @andreasisnes
Action push
Working Directory src/apps/Altinn.Authorization.DeployApi/deploy
State File github.com/altinn/altinn-authorization-tmp/environments/at22/altinn.authorization.deployapi.tfstate
Plan File github.com_altinn_altinn-authorization-tmp_environments_at22_altinn.authorization.deployapi.tfstate.tfplan

Copy link

github-actions bot commented Nov 14, 2024

Terraform environment at21

Format and Style 🖌success

Initialization ⚙️success

Validation 🤖success

Validation Output

Success! The configuration is valid.


Plan 📖success

Show Plan

[Lines containing Refreshing state removed]
[Maybe further truncated see logs for complete plan output]
Acquiring state lock. This may take a few moments...
data.azurerm_user_assigned_identity.application_admin: Reading...
module.app.data.azurerm_key_vault.kv: Reading...
module.app.data.azurerm_servicebus_namespace.sb: Reading...
module.app.data.azurerm_app_configuration.appconf: Reading...
module.app.data.azurerm_container_app_environment.caenv: Reading...
data.azurerm_user_assigned_identity.application_admin: Read complete after 1s [id=/subscriptions/45177a0a-d27e-490f-9f23-b4726de8ccc1/resourceGroups/rgauth001at21/providers/Microsoft.ManagedIdentity/userAssignedIdentities/miappadminauth001at21]
module.app.data.azurerm_container_app_environment.caenv: Read complete after 2s [id=/subscriptions/45177a0a-d27e-490f-9f23-b4726de8ccc1/resourceGroups/rgauth001at21/providers/Microsoft.App/managedEnvironments/caenvauth001at21]
module.app.data.azurerm_servicebus_namespace.sb: Read complete after 3s [id=/subscriptions/45177a0a-d27e-490f-9f23-b4726de8ccc1/resourceGroups/rgauth001at21/providers/Microsoft.ServiceBus/namespaces/sbaltinnauth001at21]
module.app.data.azurerm_app_configuration.appconf: Read complete after 3s [id=/subscriptions/45177a0a-d27e-490f-9f23-b4726de8ccc1/resourceGroups/rgauth001at21/providers/Microsoft.AppConfiguration/configurationStores/appconfaltinnauth001at21]
module.app.data.azurerm_key_vault.kv: Read complete after 5s [id=/subscriptions/45177a0a-d27e-490f-9f23-b4726de8ccc1/resourceGroups/rgauth001at21/providers/Microsoft.KeyVault/vaults/kvaltinnauth001at21]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # module.app.azurerm_container_app.app will be updated in-place
  ~ resource "azurerm_container_app" "app" {
        id                            = "/subscriptions/45177a0a-d27e-490f-9f23-b4726de8ccc1/resourceGroups/rgdeployapi001at21/providers/Microsoft.App/containerApps/cadeployapi001at21"
        name                          = "cadeployapi001at21"
        tags                          = {}
        # (9 unchanged attributes hidden)

      ~ template {
            # (2 unchanged attributes hidden)

          ~ container {
              ~ image             = "ghcr.io/altinn/altinn-authorization-tmp/altinn-authorization-deployapi:78f46c9" -> "ghcr.io/altinn/altinn-authorization-tmp/altinn-authorization-deployapi:560f38f"
                name              = "deployapi"
                # (5 unchanged attributes hidden)

                # (3 unchanged blocks hidden)
            }
        }

        # (2 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: tfplan.out

To perform exactly these actions, run the following command to apply:
    terraform apply "tfplan.out"
Releasing state lock. This may take a few moments...

Context Values
Pusher @andreasisnes
Action push
Working Directory src/apps/Altinn.Authorization.DeployApi/deploy
State File github.com/altinn/altinn-authorization-tmp/environments/at21/altinn.authorization.deployapi.tfstate
Plan File github.com_altinn_altinn-authorization-tmp_environments_at21_altinn.authorization.deployapi.tfstate.tfplan

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.

1 participant