Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
639 changes: 639 additions & 0 deletions content/packer/.github/CONTRIBUTING.md

Large diffs are not rendered by default.

50 changes: 50 additions & 0 deletions content/packer/.github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: Bug Report
about: You're experiencing an issue with Packer that is different from the documented behavior.
labels: bug
---

<!--- Please keep this note for the community --->

#### Community Note

* Please vote on this issue by adding a πŸ‘ [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment

<!--- Thank you for keeping this note for the community --->

When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.

#### Overview of the Issue

A paragraph or two about the issue you're experiencing.

#### Reproduction Steps

Steps to reproduce this issue

### Packer version

From `packer version`

### Simplified Packer Template

If the file is longer than a few dozen lines, please include the URL to the
[gist](https://gist.github.com/) of the log or use the [Github detailed
format](https://gist.github.com/ericclemmons/b146fe5da72ca1f706b2ef72a20ac39d)
instead of posting it directly in the issue.

### Operating system and Environment details

OS, Architecture, and any other information you can provide about the
environment.

### Log Fragments and crash.log files

Include appropriate log fragments. If the log is longer than a few dozen lines,
please include the URL to the [gist](https://gist.github.com/) of the log or
use the [Github detailed format](https://gist.github.com/ericclemmons/b146fe5da72ca1f706b2ef72a20ac39d) instead of posting it directly in the issue.

Set the env var `PACKER_LOG=1` for maximum log detail.
8 changes: 8 additions & 0 deletions content/packer/.github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1

blank_issues_enabled: false
contact_links:
- name: Packer Community Support
url: https://discuss.hashicorp.com/c/packer/23
about: If you have a question, or are looking for advice, please post on our Discuss forum! The community loves to chime in to help. Happy Coding!
35 changes: 35 additions & 0 deletions content/packer/.github/ISSUE_TEMPLATE/feature_requests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Feature Request
about: If you have something you think Packer could improve or add support for.
labels: enhancement
---

<!--- Please keep this note for the community --->

#### Community Note

* Please vote on this issue by adding a πŸ‘ [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment

<!--- Thank you for keeping this note for the community --->

Please search the existing issues for relevant feature requests, and use the
reaction feature
(https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/)
to add upvotes to pre-existing requests.

#### Description

A written overview of the feature.

#### Use Case(s)

Any relevant use-cases that you see.

#### Potential configuration

```
```

#### Potential References
21 changes: 21 additions & 0 deletions content/packer/.github/ISSUE_TEMPLATE/plugin_integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Plugin Integration Request
about: Open request to add your plugin as a Packer integration (https://developer.hashicorp.com/packer/integrations)
labels: integration-request
---

#### Description

A written description of your plugin along with a link to the plugin repository.

#### Integration Tier
<!--- By default all integrations are registered as community integrations.
HashiCorp Technology partners https://www.hashicorp.com/partners/find-a-partner will be registered as a partner once verified. --->

#### Checklist
- [ ] Has valid [`metadata.hcl`](https://github.com/hashicorp/integration-template) file in plugin repository.
- [ ] Has added integration scripts [packer-plugin-scaffolding](https://github.com/hashicorp/packer-plugin-scoffolding) to plugin repository.
- [ ] Has added top-level integration README.md file to plugin `docs` directory.
- [ ] All plugins components have one README.md describing their usage.
- [ ] Has a fully synced `.web-docs` directory ready for publishing to the integrations portal.

15 changes: 15 additions & 0 deletions content/packer/.github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Question
about: If you have a question, please check out our other community resources instead of opening an issue.
labels: question
---

Issues on GitHub are intended to be related to bugs or feature requests, so we
recommend using our other community resources instead of asking here if you
have a question.

- Packer Guides: https://www.packer.io/guides
- Discussion List: https://groups.google.com/group/packer-tool
- Any other questions can be sent to the packer section of the HashiCorp
forum: https://discuss.hashicorp.com/c/packer
- Packer community links: https://www.packer.io/community
23 changes: 23 additions & 0 deletions content/packer/.github/ISSUE_TEMPLATE/ssh_or_winrm_times_out.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: SSH or WinRM times out
about: I have a waiting SSH or WinRM error.
labels: communicator-question
---

Got one of the following errors ? See if the related guides can help.

- `Waiting for WinRM to become available` ?

- See our basic WinRm Packer guide: https://www.packer.io/guides/automatic-operating-system-installs/autounattend_windows

- `Waiting for SSH to become available` ?

- See our basic SSH Packer guide: https://www.packer.io/guides/automatic-operating-system-installs/preseed_ubuntu

Issues on GitHub are intended to be related to bugs or feature requests, so we recommend using our other community resources instead of asking here if you have a question.

- Packer Guides: https://www.packer.io/guides
- Discussion List: https://groups.google.com/group/packer-tool
- Any other questions can be sent to the packer section of the HashiCorp
forum: https://discuss.hashicorp.com/c/packer
- Packer community links: https://www.packer.io/community
31 changes: 31 additions & 0 deletions content/packer/.github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
**DELETE THIS PART BEFORE SUBMITTING**

In order to have a good experience with our community, we recommend that you
read the contributing guidelines for making a PR, and understand the lifecycle
of a Packer Plugin PR:
- https://github.com/hashicorp/$REPO_NAME/blob/main/.github/CONTRIBUTING.md#opening-an-pull-request

Please include tests. Check out these examples:

- https://github.com/hashicorp/packer/blob/master/builder/parallels/common/ssh_config_test.go#L34
- https://github.com/hashicorp/packer/blob/master/post-processor/compress/post-processor_test.go#L153-L182

----

### Description
What code changed, and why?

### Resolved Issues
If your PR resolves any open issue(s), please indicate them like this so they
will be closed when your PR is merged:
Closes #xxx
Closes #xxx

<!-- heimdall_github_prtemplate:grc-pci_dss-2024-01-05 -->
### Rollback Plan
If a change needs to be reverted, we will roll out an update to the code within
7 days.

### Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging)
in this pull request? If so, explain.
9 changes: 9 additions & 0 deletions content/packer/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: gomod
directory: /
schedule:
interval: daily
allow:
- dependency-name: "github.com/hashicorp/packer-plugin-sdk"
- dependency-name: "github.com/hashicorp/hcp-sdk-go"
8 changes: 8 additions & 0 deletions content/packer/.github/labeler-issue-triage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1

bug:
- 'panic:'
crash:
- 'panic:'

100 changes: 100 additions & 0 deletions content/packer/.github/workflows/acceptance-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#
# This GitHub action runs Packer's acceptance tests every night.
# Failures are reported to slack.
#

name: "Acceptance Test"

on:
# workflow_dispatch allows manual triggering of the workflow
workflow_dispatch:
schedule:
# Runs against the default branch every day at midnight
- cron: "0 0 * * *"

permissions:
contents: read

jobs:
get-go-version:
runs-on: ubuntu-latest
outputs:
go-version: ${{ steps.get-go-version.outputs.go-version }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 'Determine Go version'
id: get-go-version
# We use .go-version as our source of truth for current Go
# version, because "goenv" can react to it automatically.
run: |
echo "Building with Go $(cat .go-version)"
echo "go-version=$(cat .go-version)" >> $GITHUB_OUTPUT
acceptance-test:
runs-on: ubuntu-latest
name: Acceptance Test
needs: get-go-version
env:
# AWS Creds for Assume Role
AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }}
AWS_ACCESS_KEY_ID: ${{ secrets.TESTACC_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.TESTACC_AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.TESTACC_AWS_REGION }}
# Packer GH Token for API Rate Limiting
PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: ${{ needs.get-go-version.outputs.go-version }}
- name: IAM Assume Role
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
role-to-assume: ${{ env.AWS_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
role-duration-seconds: 3600
- name: Install gotestsum
run: go install gotest.tools/gotestsum@latest

# we set the ACC_TEST_BUILDERS="amazon-ebs" since we want to test against the amazon-ebs tests (e.g. Powershell
# provisioner acceptance tests)
- name: Run acceptance tests per module
run: |
mkdir -p /tmp/test-results
make dev
ACC_TEST_BUILDERS="amazon-ebs" PACKER_ACC=1 gotestsum --format=short-verbose --junitfile /tmp/test-results/gotestsum-report.xml -- -timeout=120m -p 2 $(go list ./... | grep -v inspec | grep -v profitbricks | grep -v oneandone)
# Send a slack notification if either job defined above fails
slack-notify:
permissions:
contents: none
needs:
- get-go-version
- acceptance-test
if: always() && (needs.get-go-version.result == 'failure' || needs.acceptance-test.result == 'failure')
runs-on: ubuntu-latest
steps:
- name: Send slack notification on failure
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
with:
payload: |
{
"text": ":alert: Packer Nightly Acceptance Tests *FAILED* :alert:",
"attachments": [
{
"color": "#C41E3A",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Branch: `${{ github.ref_name }}`\nRef: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}\nWorkflow: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
}
]
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
29 changes: 29 additions & 0 deletions content/packer/.github/workflows/auto-close-stale-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Close Stale Issues

on:
schedule:
- cron: '0 0 * * *'

permissions:
contents: read

jobs:
stale-bot:
permissions:
issues: write # for actions/stale to close stale issues
pull-requests: write # for actions/stale to close stale PRs
runs-on: ubuntu-latest
steps:
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-issue-stale: 23
days-before-pr-stale: -1 # deactivate the action for PRs
days-before-close: 7
stale-issue-message: |
Hi,

This issue has not received any update in the last 3 weeks, and will automatically be closed in 7 days if it does not receive any activity by then.

If you find the [community forum](https://discuss.hashicorp.com/c/packer) to be more helpful or if you've found the answer to your question elsewhere please feel free to post a response and close the issue.
only-labels: needs-reply
52 changes: 52 additions & 0 deletions content/packer/.github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: Backport Assistant Runner

on:
pull_request_target:
types:
- closed
- labeled

permissions:
contents: read

jobs:
backport:
permissions:
contents: none
if: github.event.pull_request.merged
runs-on: ubuntu-latest
container: hashicorpdev/backport-assistant:v0.5.8
steps:
- name: Backport changes to stable-website
run: |
backport-assistant backport -automerge
env:
BACKPORT_LABEL_REGEXP: "backport/(?P<target>website)"
BACKPORT_TARGET_TEMPLATE: "stable-{{.target}}"
GITHUB_TOKEN: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
- name: Backport changes to latest release branch
run: |
resp=$(curl -f -s "https://api.github.com/repos/$GITHUB_REPOSITORY/labels?per_page=100")
ret="$?"
if [[ "$ret" -ne 0 ]]; then
echo "The GitHub API returned $ret"
exit $ret
fi
# get the latest backport label excluding any website labels, ex: `backport/0.3.x` and not `backport/website`
latest_backport_label=$(echo "$resp" | jq -r '.[] | select(.name | (startswith("backport/") and (contains("website") | not))) | .name' | sort -rV | head -n1)
echo "Latest backport label: $latest_backport_label"
# set BACKPORT_TARGET_TEMPLATE for backport-assistant
# trims backport/ from the beginning with parameter substitution
export BACKPORT_TARGET_TEMPLATE="release/${latest_backport_label#backport/}"
backport-assistant backport -automerge
env:
BACKPORT_LABEL_REGEXP: "backport/(?P<target>website)"
GITHUB_TOKEN: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
- name: Backport changes to targeted release branch
run: |
backport-assistant backport -automerge
env:
BACKPORT_LABEL_REGEXP: "backport/(?P<target>\\d+\\.\\d+\\.\\w+)"
BACKPORT_TARGET_TEMPLATE: "release/{{.target}}"
GITHUB_TOKEN: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
Loading
Loading