tvon / concourse-packer-resource

a concourse-ci resource for building images via packer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

concourse packer resource

a concourse-ci resource for building images via packer

table of contents

behaviour

check: not implemented

in: not implemented

out: build a new image

parameters

  • template: required. the path to the packer template file.

  • env_vars: optional. dict of variables to set in the environment.

  • env_vars_from_files: optional. dict of vars and file paths to set in the environment.

  • var_files: optional. the list of paths to external JSON variable file(s).

  • vars: optional. dict of explicit packer variable key/value pairs.

  • vars_from_files: optional. dict of vars and file paths to use as their value.

  • force: optional. set to true to enable the force option during a packer build. default: false

  • debug: optional. set to true to dump argument values and parsed output. may result in leaked credentials. default: false

the id of the first artifact produced will be used as the version, with the full artifact details in the output metadata

note: in an effort to prevent credentials leaking to logs, the full packer command line will not be printed on failure -- however, you should still mark any relevant variables as sensitive variables in the packer template to prevent packer from printing them in log output

the packer executable will have a working directory of the concourse input directory, so file paths can be relative to resources, or absolute paths

examples

resource_types:
- name: packer
  type: docker-image
  source:
    repository: snapkitchen/concourse-packer-resource
    tag: 1.4.3

resources:
- name: build-ami
  type: packer

jobs:
- name: my-ami
  plan:
  - get: my-ami-template
  - get: role-credentials
  - put: build-ami
    params:
      template: my-ami-template/template.json
      var_files:
      - my-ami-template/my-vars.json
      env_vars:
        AWS_DEFAULT_REGION: ((aws_region))
      env_vars_from_files:
        AWS_ACCESS_KEY_ID: role-credentials/access-key-id
        AWS_SECRET_ACCESS_KEY: role-credentials/secret-access-key
        AWS_SESSION_TOKEN: role-credentials/session-token
      vars:
        environment: dev
        package_version: 1.2.3
      vars_from_files:
        commit_ref: my-ami-template/.git/short_ref

license

see LICENSE

About

a concourse-ci resource for building images via packer

License:MIT License


Languages

Language:Python 85.5%Language:Shell 10.1%Language:Dockerfile 4.4%