Git Product home page Git Product logo

drone-packer's Introduction

Drone Packer

A Drone plugin to run packer builds.

Usage

pipeline:
  build:
    image: kayako/drone-packer
    include_files: [ config/common.json, config/<target> ]
    target: base.json
    variables:
        name: packer
        version: 33

Plugin Configuration

  • account: AWS account ID in which to assume the role. Instance IAM role will be used by default
  • use_ci_role: IAM role name to use. Defaults to ci. Ignored if account is not provided
  • target: Name of target packer template to execute
  • variables: Optional variables to pass to packer build command
  • secret_variables: List of variables to be read from environment
  • include_files: List of variable files to include in build
  • except: List of builders to skip
  • only: List of builders to run

Notes

  • target must be the name of the target template. target can be provided as plugin parameter in .drone.yml file or it can be passed as deployment parameter using either drone CLI or github deployment api.
  • variables is optional and must be a flat dictionary. An intact JSON representation of the dictionary will be passed to packer.
  • include_files is an optional list of path to JSON files relative to build directory. It can contain <target> literal string which will be replaced by actual target name as provided to the plugin.
  • except and only, if provided, must be valid Yaml list types.
  • secret_variables is an optional list of variable names that should be read from environment. Make sure to whitelist the secrets in drone configuration file

Example

Following configuration

pipeline:
  build:
    image: kayako/drone-packer
    include_files: [ config/common.json, config/<target> ]
    target: base.json
    variables:
        name: packer
        version: 33
    secret_variables: [ vpc_id, subnet_id ]
    secrets: [ vpc_id, subnet_id ]

will create a temporary file build_variables.json containing the variables:

{
  "name": "packer",
  "version": 33
}

and run the command without line breaks.

packer build --var-file build_variables.json \
    --var-file config/common.json \
    --var-file config/base.json \
    --var 'vpc_id=vpc-id-in-env' \
    --var 'subnet_id=subnet-id-in-env' \
    base.json

drone-packer's People

Contributors

gufran avatar

Watchers

James Cloos 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.