Skip to content

Latest commit

 

History

History
50 lines (37 loc) · 2.73 KB

README.adoc

File metadata and controls

50 lines (37 loc) · 2.73 KB

Jenkins Infra on CloudFlare

This repository hosts the infrastructure-as-code definition for all the CloudFlare resources for the Jenkins Infrastructure Project.

Requirements

  • A CloudFlare account with an API token defined as the value of the environment variable TF_VAR_cloudflare_api_token

  • The requirements (of the shared tools) listed at shared-tools/terraform#requirements

  • The Terraform AzureRM Backend Configuration on a local file named backend-config:

  • The git command line to allow cloning the repository and its submodule shared-tools

    • This repository has submodules. Once you cloned the repository, execute the following command to retrieve the shared tools:

git submodule update --init --recursive

HowTo

Provision

Important
Don’t blindly execute the terraform code located in this repository on your own account as it may lead your account bill to significantly increase.

Once you’ve fulfilled the Requirements, you may execute any of the available commands by adding the correct flag --directory pointing to .shared-tools/terraform/:

make --directory=.shared-tools/terraform help
make --directory=.shared-tools/terraform lint
# ...

An usual workflow to update this repository looks like the following:

  • Fork the repository and clone it locally

  • Follow the Requirements steps to retrieve the shared tools

  • Start by running a full make --directory=.shared-tools/terraform validate command to ensure that you work on a sane base (should generate a report TXT file with no changes to be applied)

  • Edit the Terraform project files

  • Run the command make --directory=.shared-tools/terraform validate again to review and ensure that your changes are OK

  • Commit, push and open a pull request to let the Jenkins pipeline run the test + plan (as per https://github.com/jenkins-infra/shared-tools/blob/main/terraform/README.adoc#jenkins-pipeline)

Troubleshoot