Skip to content

blairnangle/openjdk-gradle-terraform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openjdk-gradle-terraform

CircleCI

OpenJDK Docker image with Python 3, pip, Gradle, Terraform, Checkov and the AWS CLI tool. See Dockerfile for exact versions.

Written with the intention of creating a single, consistent CircleCI container image for Java applications that deploy their infrastructure with Terraform in the same pipeline (but are not necessarily deployed as containerized applications).

Published via CircleCI to Docker Hub.

Usage

Simple example of a CircleCI pipeline for a Gradle project dummy with a terraform subdirectory containing its infrastructure code that makes use of the aws-cli orb to set up credentials (using default environment variables configured in CircleCI):

version: 2.1

executors:
  openjdk-gradle-terraform:
    docker:
      - image: blairnangle/openjdk-gradle-terraform:latest

orbs:
  aws-cli: circleci/[email protected]

workflows:
  version: 2
  build_and_later_some_other_stuff:
    jobs:
      - build
      - infra

jobs:
  build:
    executor: openjdk-gradle-terraform
    steps:
      - checkout
      - run:
          name: Build
          command: gradle build
  infra:
    executor: openjdk-gradle-terraform
    working_directory: ~/dummy/terraform
    steps:
      - checkout:
          path: ~/dummy
      - aws-cli/setup
      - run:
         name: Initialize
         command: terraform init
      - run:
          name: Validate
          command: terraform validate
      - run:
          name: Check
          command: checkov -d .
      - run:
          name: Plan
          command: terraform plan --out plan.tf
      - run:
          name: Apply
          command: terraform apply plan.tf

The pipeline is basic (does not actually deploy an artifact, for example) and the planning and application of the Terraform infrastructure should probably be split into separate jobs, but it illustrates the tools that are made available to CircleCI by using the blairnangle/openjdk-gradle-terraform image.

License

Distributed under MIT License.

Releases

No releases published

Packages

No packages published