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

Adds instructions to deploy locally without Cloud Build. #105

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

amandakarina
Copy link
Owner

@amandakarina amandakarina commented Aug 13, 2024

TODOs:

  • Add empty commit in each local repo
  • Add env promotion aka.: git merge from dev to nonprod to prod
  • Follow the same tone/text of instructions in all steps.
  • Remove BU2 copy instructions until fix
  • Add step 5-app-infra instructions
  • Remove cloud build from 4-projects

@amandakarina amandakarina force-pushed the fix/add-local-deployment-instructions branch from 525d0f4 to ec5b86e Compare August 14, 2024 17:57
Copy link

@caetano-colin caetano-colin left a comment

Choose a reason for hiding this comment

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

Reviewed the style and gave optional suggestions

0-bootstrap/README.md Outdated Show resolved Hide resolved
0-bootstrap/README.md Outdated Show resolved Hide resolved
0-bootstrap/README.md Outdated Show resolved Hide resolved
0-bootstrap/README.md Outdated Show resolved Hide resolved
0-bootstrap/README.md Outdated Show resolved Hide resolved
4-projects/README.md Outdated Show resolved Hide resolved
2-environments/README.md Outdated Show resolved Hide resolved
2-environments/README.md Outdated Show resolved Hide resolved
2-environments/README.md Outdated Show resolved Hide resolved
2-environments/README.md Outdated Show resolved Hide resolved
0-bootstrap/README.md Outdated Show resolved Hide resolved
Co-authored-by: Caetano Colin <164910343+caetano-colin@users.noreply.github.com>
Copy link
Collaborator

@renato-rudnicki renato-rudnicki left a comment

Choose a reason for hiding this comment

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

LGTM.

@caetano-colin
Copy link

caetano-colin commented Aug 15, 2024

@amandakarina how did you run the 4-projects step?

in my case it was not working because in cb.tf at bootstrap, the gcs_projects bucket is created, and we discard the file by renaming it to cb.tf.example:

module "gcp_projects_state_bucket" {
  source  = "terraform-google-modules/cloud-storage/google//modules/simple_bucket"
  version = "~> 6.0"

  name          = "${var.bucket_prefix}-${module.seed_bootstrap.seed_project_id}-gcp-projects-tfstate"
  project_id    = module.seed_bootstrap.seed_project_id
  location      = var.default_region
  force_destroy = var.bucket_force_destroy

  encryption = {
    default_kms_key_name = local.state_bucket_kms_key
  }

  depends_on = [module.seed_bootstrap.gcs_bucket_tfstate]
}

I was able to run by creating the module above in a separate file, have you done something different?

@caetano-colin
Copy link

caetano-colin commented Aug 15, 2024

Here is a PR to your branch fix/add-local-deployment-instructions with some fixes: #106

The issue addressed in the comment above is not contemplated in this PR

0-bootstrap/README.md Outdated Show resolved Hide resolved
@amandakarina amandakarina force-pushed the fix/add-local-deployment-instructions branch from 631c5b6 to 9e038ef Compare August 19, 2024 19:15
@amandakarina amandakarina force-pushed the fix/add-local-deployment-instructions branch from b796b10 to 91b1f2a Compare August 19, 2024 19:51
@amandakarina
Copy link
Owner Author

@amandakarina how did you run the 4-projects step?

in my case it was not working because in cb.tf at bootstrap, the gcs_projects bucket is created, and we discard the file by renaming it to cb.tf.example:

module "gcp_projects_state_bucket" {
  source  = "terraform-google-modules/cloud-storage/google//modules/simple_bucket"
  version = "~> 6.0"

  name          = "${var.bucket_prefix}-${module.seed_bootstrap.seed_project_id}-gcp-projects-tfstate"
  project_id    = module.seed_bootstrap.seed_project_id
  location      = var.default_region
  force_destroy = var.bucket_force_destroy

  encryption = {
    default_kms_key_name = local.state_bucket_kms_key
  }

  depends_on = [module.seed_bootstrap.gcs_bucket_tfstate]
}

I was able to run by creating the module above in a separate file, have you done something different?

The projects state bucket creation was moved from cb.tf tot main.tf.

@caetano-colin
Copy link

After testing your PR, here are some key points:

  • at 0-bootstrap, in sa.tf the field local.cicd_project_id also needed to be commented out to run terraform plan/apply. Besides that, 1-org to 4-projects is running smoothly
  • I'm gonna make a PR to your branch addressing the local.cicd_project_id issue

@caetano-colin
Copy link

PR: #109

@amandakarina amandakarina reopened this Nov 4, 2024
@amandakarina amandakarina force-pushed the fix/add-local-deployment-instructions branch from 1958866 to 5adbebd Compare November 12, 2024 12:10
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.

5 participants