Giter VIP home page Giter VIP logo

terraform-plugin's Introduction

Terraform plugin

Jenkins Plugin Jenkins Plugin Installs GitHub release

About this plugin

The Terraform plugin for Jenkins adds an installer for Terraform and provides a job build wrapper for creating (and destroying) infrastructure.

The installer generates a list of Terraform binaries for installation from bintray.com, see Terraform Crawler.

Usage

Tool Installation

Terraform binaries can be installed via Manage Jenkins > Global Tool Configuration. Select a label, version and platform to install.

Job Configuration

This plugin works as a build wrapper and can be invoked by selecting Terraform under the Build Environment section of your job configuration.

A workspace directory terraform-plugin will be created, this is where temporary files are created and automatically deleted after runs.

This directory also contains the generated tfstate file terraform-plugin.tfstate.

This generated tfstate file is not deleted and is always passed to Terraform using -state=workspace/terraform-plugin/terraform-plugin.tfstate as an extra safety measure so as to not use any other tfstate file you might have in a workspace.

The first step is to decide how you would like to pass your configurations to Terraform, there are 2 options:

Option 1: Configuration text

This option allows you to copy what would be in a resource file (.tf) into a textarea. This text will then be written to a temporary file (workspace/terraform-plugin/terraform-TEMP.tf) and parsed by Terraform.

Option 2: Configuration path

This option provides a directory path (relative to your workspace) to enter where your configuration files (.tf) exist. If no path is given, it defaults to the workspace path.

Additional configuration options

Update modules

Terraform will run the get command by default, use this option to run Terraform get with the -update flag.

Resource variables

If you are using resource files that reference external variables, set these variables here.

These variables will be written to a temporary file (workspace/terraform-plugin/variables-TEMP.tfvars) and will be passed to Terraform using the --var-file= option.

Advanced

If you want to destroy the architecture you have created once the build is complete, click the advanced button and check Destroy On Build Completion.

This will call Terraform with the destroy --force option which will look at the generated terraform-plugin.tfstate file (workspace/terraform-plugin/terraform-plugin.tfstate) and destroy everything under Terraform supervision.

Developer Instructions

This plugin uses gradle wrapper, so the only dependency is a working JDK (7/8).

  • To build the .hpi plugin (build/libs/jenkins-terraform.hpi)
./gradlew jpi
./gradlew server
  • To prepare a release (and set next release version)
./gradlew release
  • To publish a release to update center (for Maintainer(s))
./gradlew publish

License

MIT

More information

terraform-plugin's People

Contributors

dpires avatar jambit-admin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.