packer-post-processor-redis

command module
v0.0.0-...-5f76d29 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 31, 2019 License: MIT Imports: 2 Imported by: 0

README

Packer Redis post processor

Codeship Status for motymichaely/packer-post-processor-redis

Packer Redis post processor is a Packer post processor plugin to store builder artifacts metadata into a Redis server for later retrieval.

This project was inspired by Packer Consul post processor.

Usage

Installation

You first need to install the plugin on your machine and let packer be aware of it.

Run:

$ go get github.com/motymichaely/packer-post-processor-redis
$ go install github.com/motymichaely/packer-post-processor-redis

Copy the binary file into your packer plugins folder:

$ mkdir $HOME/.packer.d/plugins
$ cp $GOPATH/bin/packer-post-processor-redis $HOME/.packer.d/plugins

Add the post-processor to Packer config file (~/.packerconfig):

{
  "post-processors": {
    "redis": "packer-post-processor-redis"
  }
}
Configuration

The configuration for this post-processor is extremely simple.

redis_url (string) - Your access token for the Atlas API. This can be generated on your tokens page. Alternatively you can export your Redis URL as an environmental variable and remove it from the configuration. Note

key_prefix (string) - The prefix of the key to be set, i.e my_service/images. for builders that support multiple regions, the prefix will be appended with the region to the key prefix, i.e my_service/images/<region>.

Add the post-processor to your packer template:

{
    "builders": [{
        "type": "amazon-ebs",
        "region": "us-east-1",
        "ami_regions": ["us-east-1", "us-west-1"],
        ...
        }]
    "post-processors": [
      {
        "type": "redis",
        "redis_url": "redis://localhost:6379/0",
        "key_prefix": "my_service/images",
        "only": ["amazonebs"]
      }
    ]
}

This example would take each artifact that was built by the "amazonebs" builder and set the keys my_service/images/us-east-1 and my_service/images/us-west-1 with a value of the image id, i.e ami_5123412.

Building

Build & Test:

$ make all

Build:

$ make bin

Test:

$ make test

Contribute

See the CONTRIBUTING file for contribution guidelines.

License

Copyright (c) 2015 Moty Michaely

See the LICENSE file for license rights and limitations (MIT).

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL