# README
Git Packer Plugin
A plugin for Packer which provides access to git. Compatible with Packer >= 1.7.0
Under the hood, it uses go-git.
Usage
Add the plugin to your packer config:
packer {
required_plugins {
git = {
version = ">= 0.6.2"
source = "github.com/ethanmdavidson/git"
}
}
}
Add the data source:
data "git-commit" "example" { }
Now you should have access to info about the commit:
locals {
hash = data.git-commit.example.hash
}
Examples
See the examples directory for some example code.
Components
See the docs for a reference of all the available components and their attributes.
Development
The GNUmakefile has all the commands you need to work with this repo. The typical development flow looks something like this:
- Make code changes, and add test cases for these changes.
- Run
make generate
to recreate generated code. - Run
make dev
to build the plugin and install it locally. - Run
make testacc
to run the acceptance tests. If there are failures, go back to step 1. - Update examples in
./example
directory if necessary. - Run
make run-example
to test examples. - Once the above steps are complete: commit, push, and open a PR!
For local development, you will need to install:
Check out the Packer docs on Developing Plugins for more detailed info on plugins.
# Packages
Package common contains some logic that is shared by all datasources.
No description provided by the author
# Variables
PluginVersion is used by the plugin set to allow Packer to recognize what version this plugin is.
Version is the main version number that is being run at the moment.