packer-plugin-git

command module
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

README

Git Packer Plugin

tests

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:

  1. Make code changes, and add test cases for these changes.
  2. Run make generate to recreate generated code.
  3. Run make dev to build the plugin and install it locally.
  4. Run make testacc to run the acceptance tests. If there are failures, go back to step 1.
  5. Update examples in ./example directory if necessary.
  6. Run make run-example to test examples.
  7. 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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package common contains some logic that is shared by all datasources
Package common contains some logic that is shared by all datasources
datasource
commit
Package commit contains logic for providing commit data to Packer
Package commit contains logic for providing commit data to Packer
repository
Package repository contains logic for providing repo data to Packer
Package repository contains logic for providing repo data to Packer
tree
Package tree contains logic for providing working tree data to Packer
Package tree contains logic for providing working tree data to Packer

Jump to

Keyboard shortcuts

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