configuration-as-code-plugin/demos/terraform
Joseph Petersen 3ef37525f1
🗑️ Codacy markdown issues (#848)
2019-04-20 15:50:58 +02:00
..
README.md 🗑️ Codacy markdown issues (#848) 2019-04-20 15:50:58 +02:00

README.md

example of how to configure terraform plugin

Prerequisites

to test it from root of the current repository:

export CASC_JENKINS_CONFIG=$(PWD)/demos/terraform/jenkins.yaml
mvn hpi:run

You need to install the following plugins to make it work (you can do it before using the export):

  • Configuration As Code
  • Configuration As Code Support
  • Job DSL
  • SSH Credentials

Sample

jenkins:
  systemMessage: "Jenkins configured automatically by Jenkins Configuration as Code plugin\n\n"

tool:
  terraforminstallation:
    installations:
      - name: terraform
        home: ""
        properties:
          - installSource:
              installers:
                - terraformInstaller:
                    id: "0.11.9-linux-amd64"

jobs:
  - script: >
      job("terraform-job") {
        description()
        keepDependencies(false)
        disabled(false)
        concurrentBuild(false)
        wrappers {
           terraformBuildWrapper {
              variables("") 
              terraformInstallation("terraform")
              doGetUpdate(true)
              doNotApply(false)
              doDestroy(false)
              config {
                 value("inline")
                 inlineConfig("")
                 fileConfig("")
              }
           }
        }
      }