Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b5a02ec
Update version.go
ddreggors Apr 15, 2025
9232724
Update release.yml
ddreggors Apr 15, 2025
773deea
Update release-drafter.yml
ddreggors Apr 15, 2025
a6b33bb
Update go-validate.yml
ddreggors Apr 15, 2025
e5873c2
Update go-test-linux.yml
ddreggors Apr 15, 2025
fcb19e7
Set Go version and use it
ddreggors Apr 15, 2025
fd0a13b
Update .go-version
ddreggors Apr 16, 2025
8bec3ee
Updates to go
ddreggors Apr 16, 2025
911c449
Remove gpg Import
ddreggors Apr 16, 2025
74e2b44
Test
ddreggors Apr 16, 2025
92fc0f7
More tests
ddreggors Apr 16, 2025
8762217
Fix release
ddreggors Apr 16, 2025
2ea0a9a
Fix version
ddreggors Apr 16, 2025
0b145a5
Fix releaser
ddreggors Apr 16, 2025
bb85bdc
Add version
ddreggors Apr 16, 2025
8beb10f
Fix gorelaser config
ddreggors Apr 16, 2025
ffa05f7
Fixes
ddreggors Apr 16, 2025
537de62
Add puctuation
ddreggors Apr 16, 2025
7b3b9b2
Use packer-sdc plugin-check now
ddreggors Apr 16, 2025
e19c57d
Fix tagging
ddreggors Apr 16, 2025
75e558d
Add gpg Fingerprint
ddreggors Apr 16, 2025
021b7bf
Add passphrase for gpg key
ddreggors Apr 16, 2025
69695e7
Update release
ddreggors Apr 16, 2025
ee48afa
Fix lint step
ddreggors Apr 17, 2025
24d8938
Switch to non-local runners for go-validate tests
ddreggors Apr 17, 2025
c52badd
Revert golint version
ddreggors Apr 17, 2025
57e7f2a
Updates
ddreggors Apr 17, 2025
c8efff1
Update golangci-lint
ddreggors Apr 17, 2025
25d466a
With golangci-lint version 2.1.2
ddreggors Apr 17, 2025
d01ae47
Fix Go root and remove manual install of go lint
ddreggors Apr 17, 2025
570d1ff
Update for Ubuntu latest
ddreggors Apr 17, 2025
bed9af3
Testing new badges in readme
ddreggors Apr 17, 2025
e8097c0
Cleanup
ddreggors Apr 17, 2025
664db15
Fix runs-on
ddreggors Apr 17, 2025
f804e29
Remove manual code to use 2.1.2 for golangci-lint
ddreggors Apr 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ updates:
schedule:
interval: "daily"

- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "daily"
10 changes: 6 additions & 4 deletions .github/workflows/go-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This GitHub action runs basic linting checks for Packer.
#

name: "Go Validate"
name: "Go Validation"

on:
push:
Expand Down Expand Up @@ -44,9 +44,11 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: ${{ needs.get-go-version.outputs.go-version }}
- uses: golangci/golangci-lint-action@v6
check-latest: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v7
with:
version: v1.47.3
version: v2.1.2
only-new-issues: true
check-fmt:
needs:
Expand Down Expand Up @@ -78,4 +80,4 @@ jobs:
go-version: ${{ needs.get-go-version.outputs.go-version }}
- run: |
export PATH=$PATH:$(go env GOPATH)/bin
make generate
make generate
40 changes: 28 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
# This GitHub action can publish assets for release when a tag is created.
# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0).
#
# This uses an action (hashicorp/ghaction-import-gpg) that assumes you set your
# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE`
# secret. If you would rather own your own GPG handling, please fork this action
# or use an alternative one for key handling.
#
# You will need to pass the `--batch` flag to `gpg` in your signing step
# in `goreleaser` to indicate this is being used in a non-interactive mode.
#
name: release
name: Build and Release
on:
push:
tags:
- 'v*'
workflow_call:
secrets:
PASSPHRASE:
description: 'A GPG Key passphrase passed from the caller workflow'
required: false
FINGERPRINT:
description: 'A GPG Key fingerprint passed from the caller workflow'
required: false
jobs:
get-go-version:
runs-on: ubuntu-latest
outputs:
go-version: ${{ steps.get-go-version.outputs.go-version }}
steps:
- uses: actions/checkout@v4
- name: 'Determine Go version.'
id: get-go-version
run: |
echo "Found Go $(cat .go-version)"
echo "go-version=$(cat .go-version)" >> $GITHUB_OUTPUT
goreleaser:
needs:
- get-go-version
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -25,7 +38,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.16
go-version: ${{ needs.get-go-version.outputs.go-version }}
- name: Describe plugin
id: plugin_describe
run: echo "::set-output name=api_version::$(go run . describe | jq -r '.api_version')"
Expand All @@ -38,8 +51,11 @@ jobs:
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --rm-dist
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
# 'latest', 'nightly', or a semver (Example: ~> v2)
version: '~> v2'
args: release --clean
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-plugin-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ jobs:
working_directory: ${{ github.event.inputs.folder }}
command: build
env:
PACKER_LOG: ${{ github.event.inputs.logs }}
PACKER_LOG: ${{ github.event.inputs.logs }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
main
dist/*
packer-plugin-podman
.idea/
.idea/
.vscode
.lock
.DS_Store
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.18.8
1.24
26 changes: 14 additions & 12 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ before:
- go test ./...
# As part of the release doc files are included as a separate deliverable for
# consumption by Packer.io. To include a separate docs.zip uncomment the following command.
#- make ci-release-docs
# - make ci-release-docs
builds:
# A separated build to run the packer-plugins-check only once for a linux_amd64 binary
-
Expand All @@ -19,11 +19,11 @@ builds:
post:
# This will check plugin compatibility against latest version of Packer
- cmd: |
go install github.com/hashicorp/packer/cmd/packer-plugins-check@latest &&
packer-plugins-check -load={{ .Name }}
go install github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc@latest &&
packer-sdc plugin-check {{ .Name }}
dir: "{{ dir .Path}}"
flags:
- -trimpath #removes all file system paths from the compiled executable
- -trimpath # removes all file system paths from the compiled executable
ldflags:
- '-s -w -X {{ .ModulePath }}/version.Version={{.Version}} -X {{ .ModulePath }}/version.VersionPrerelease= '
goos:
Expand All @@ -34,7 +34,7 @@ builds:
-
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath #removes all file system paths from the compiled executable
- -trimpath # removes all file system paths from the compiled executable
ldflags:
- '-s -w -X {{ .ModulePath }}/version.Version={{.Version}} -X {{ .ModulePath }}/version.VersionPrerelease= '
goos:
Expand All @@ -54,10 +54,10 @@ builds:
goarch: amd64
binary: '{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}'
archives:
- format: zip
files:
- none*
name_template: '{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}'
- formats: ['zip']
files:
- none*
name_template: '{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}'
checksum:
name_template: '{{ .ProjectName }}_v{{ .Version }}_SHA256SUMS'
algorithm: sha256
Expand All @@ -78,8 +78,10 @@ release:
# draft: true
# As part of the release doc files are included as a separate deliverable for consumption by Packer.io.
# To include a separate docs.zip uncomment the extra_files config and the docs.zip command hook above.
#extra_files:
#- glob: ./docs.zip
# extra_files:
# - glob: ./docs.zip

changelog:
skip: true
disable: true

version: 2
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Packer Plugin for Podman

[![Go Code Validation](https://github.com/ddreggors/packer-plugin-podman/actions/workflows/go-validate.yml/badge.svg)](https://github.com/ddreggors/packer-plugin-podman/actions/workflows/go-validate.yml) [![Build/Release](https://github.com/ddreggors/packer-plugin-podman/actions/workflows/release.yml/badge.svg)](https://github.com/ddreggors/packer-plugin-podman/actions/workflows/release.yml)

This repository contains a Packer Plugin for Podman. It directly takes the source code from
[github.com/hashicorp/packer-plugin-docker](https://github.com/hashicorp/packer-plugin-docker) and it "remixes" it to
make it work with Podman. I've simply taken the default scaffolder, run sed on it (`scaffolder -> podman`) and the used
Expand Down Expand Up @@ -42,7 +44,7 @@ This will help test and validate plugin releases.
# Requirements

- [packer-plugin-sdk](https://github.com/hashicorp/packer-plugin-sdk) >= v0.1.0
- [Go](https://golang.org/doc/install) >= 1.16
- [Go](https://golang.org/doc/install) >= 1.24

## Packer Compatibility
This podman template is compatible with Packer >= v1.7.0
This podman template is compatible with Packer >= v1.12.0
94 changes: 92 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,103 @@
module packer-plugin-podman

go 1.16
go 1.23.8

require (
github.com/hashicorp/go-version v1.7.0
github.com/hashicorp/hcl/v2 v2.20.1
github.com/hashicorp/packer-plugin-sdk v0.5.2
github.com/hashicorp/packer-plugin-sdk v0.6.1
github.com/mitchellh/mapstructure v1.5.0
github.com/zclconf/go-cty v1.14.2
)

require (
cloud.google.com/go v0.110.8 // indirect
cloud.google.com/go/compute v1.23.1 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.3 // indirect
cloud.google.com/go/storage v1.35.1 // indirect
github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c // indirect
github.com/ChrisTrenkamp/goxpath v0.0.0-20210404020558-97928f7e12b6 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
github.com/aws/aws-sdk-go v1.44.114 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/cenkalti/backoff/v3 v3.2.2 // indirect
github.com/dylanmei/iso8601 v0.1.0 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/go-jose/go-jose/v4 v4.0.5 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/gofrs/uuid v4.0.0+incompatible // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/hashicorp/consul/api v1.25.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-getter/gcs/v2 v2.2.2 // indirect
github.com/hashicorp/go-getter/s3/v2 v2.2.2 // indirect
github.com/hashicorp/go-getter/v2 v2.2.2 // indirect
github.com/hashicorp/go-hclog v1.6.3 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 // indirect
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
github.com/hashicorp/go-sockaddr v1.0.7 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/serf v0.10.1 // indirect
github.com/hashicorp/vault/api v1.14.0 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/klauspost/compress v1.11.2 // indirect
github.com/kr/fs v0.1.0 // indirect
github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786 // indirect
github.com/masterzen/winrm v0.0.0-20210623064412-3b76017826b0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/go-fs v0.0.0-20180402235330-b7b9ca407fff // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/iochan v1.0.0 // indirect
github.com/mitchellh/reflectwalk v1.0.0 // indirect
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect
github.com/packer-community/winrmcp v0.0.0-20180921211025-c76d91c1e7db // indirect
github.com/pkg/sftp v1.13.2 // indirect
github.com/ryanuber/go-glob v1.0.0 // indirect
github.com/ugorji/go/codec v1.2.6 // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/crypto v0.36.0 // indirect
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect
golang.org/x/mod v0.24.0 // indirect
golang.org/x/net v0.37.0 // indirect
golang.org/x/oauth2 v0.13.0 // indirect
golang.org/x/sync v0.12.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/term v0.30.0 // indirect
golang.org/x/text v0.23.0 // indirect
golang.org/x/time v0.11.0 // indirect
golang.org/x/tools v0.31.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.150.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
)

replace github.com/zclconf/go-cty => github.com/nywilken/go-cty v1.13.3 // added by packer-sdc fix as noted in github.com/hashicorp/packer-plugin-sdk/issues/187
Loading