Skip to content

paolajuarezgomez/COA_DevOps_TF

Repository files navigation

COA DevOps Training UseCase.

-- How to build a pipeline with OCI DevOps --

This example creates an Autonomous Database (JSON) exposed to the public Internet.

✅ Showcase

During this UseCase we're going to:

  • Use OCI DevOps service.
  • Configure a CI/CD pipeline.
  • Use OCI S3 as a backed for terraform.
  • Use OCI Vault for storing sensitive information.
  • Deploy IaC using Terraform, in this case an ADB resource.

✅ Usage

  • Create an object storage bucket called "terraform-backend".
  • We want to use a S3-Compatible Backend , read the documentation carefully.
  • Create a "Customer Secret keys" also named as "Amazon S3 Compatibility API keys". A Customer Secret key consists of an Access Key/Secret key pair.
  • Declare the below variables to OCI vault as secrets
aws_access_key_id 
aws_secret_access_key 
user_ocid
fingerprint
  • Clone this repo in OraHub, GitLab or GitHub and create you own DevOps repository.

  • Fill the correct OCID values of secrets in file build_spec.yaml

  • Add your api_private_key to the file user.pem

  • Rename the file terraform.tfvars.template to terraform.tfvars and add the values of your tenancy_ocid and compartment_ocid

  • Define the values of your region and adb_password in the file adb.auto.tfvars

  • Define the values of your region and namespace in the file remote_backend.tf

  • Create a OCI DevOps Project

  • Review OCI documentation and add the required DG and policies.

  • Configure a code repository in DevOps to mirror the repository you have created in the previous step. DevOps Repository Mirroring

  • Create a build pipeline and create a manage build. BuildPipeline AddStage ManageBuild AddStage AddStage

  • Enable logging. Logging

  • Run the build pipeline manually and review the implementation.

manually

RunProgress

steps Logs

  • Check that now you can see the database provisioned in your compartment. steps

  • If you have arrived at this point with a successful outcome, you can add a trigger to lunch the pipeline automatically after any push action to your repository.

trigger createtrigger Add

  • Remove manually (using OCI Console) the ADB created previously.
  • Change you repo code, for example change the ADB name, and push the changes.
  • Review the outcome:

Outcome ConsoleOutcome

If you need help, ask us in the slack channel #iac-enablement

✅ References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages