Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 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
1b327e2
Use new gpg import libs
ddreggors Apr 17, 2025
8a669f0
Linter updates
ddreggors Apr 18, 2025
aab2db7
Better naming for GitHub Actions
ddreggors Apr 18, 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
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: draft-release
name: Draft Release
on:
pull_request_target:
types:
Expand Down
50 changes: 34 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,63 @@
# 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
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Unshallow
run: git fetch --prune --unshallow
- 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')"
- name: Import GPG key
id: import_gpg
uses: hashicorp/ghaction-import-gpg@v2.1.0
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
- 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
4 changes: 2 additions & 2 deletions .github/workflows/test-plugin-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# It uses Packer at latest version to init, validate and build
# an example configuration in a folder.
# This action is compatible with Packer v1.7.0 or later.
name: test plugin example
name: Test Plugin Example

on:
workflow_dispatch:
Expand Down 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
28 changes: 15 additions & 13 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 @@ -67,7 +67,7 @@ signs:
# if you are using this is in a GitHub action or some other automated pipeline, you
# need to pass the batch flag to indicate its not interactive.
- "--batch"
- "--local-user"
- "--u"
- "{{ .Env.GPG_FINGERPRINT }}"
- "--output"
- "${signature}"
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
Loading