generated from hashicorp/packer-plugin-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Register plug-in as Packer integration #116
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0c57b45
Upgrade plugin for integrations library
6c83642
Adds name
f9b5a7c
Update README for integration framework
nywilken ff16cfd
Update integration Organization name
nywilken e7b2d77
Update identifier in workflows
nywilken f209a00
Makefile: replace build-docs by generate
lbajolet-hashicorp e6a1a68
metadata: add summary for plugin
lbajolet-hashicorp b031f5f
.web-docs/metadata.hcl: Update component slugs
nywilken f16b486
docs/README.md: Fix broken plugin links on integration portal
nywilken 8b9b1c7
workflows: remove ensure-docs-compiled
lbajolet-hashicorp 666511f
workflows: release use make for docs checks
lbajolet-hashicorp 57e8d80
.web-docs: update generated README
lbajolet-hashicorp 5978ef6
Merge branch 'main' into main
andrewsomething File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
.github/workflows/notify-integration-release-via-manual.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Manual release workflow is used for deploying documentation updates | ||
# on the specified branch without making an official plugin release. | ||
name: Notify Integration Release (Manual) | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "The release version (semver)" | ||
default: 1.0.0 | ||
required: false | ||
branch: | ||
description: "A branch or SHA" | ||
default: 'main' | ||
required: false | ||
jobs: | ||
notify-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout this repo | ||
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | ||
with: | ||
ref: ${{ github.event.inputs.branch }} | ||
# Ensure that Docs are Compiled | ||
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 | ||
- name: check docs are up-to-date | ||
shell: bash | ||
run: make check-generate | ||
# Perform the Release | ||
- name: Checkout integration-release-action | ||
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | ||
with: | ||
repository: hashicorp/integration-release-action | ||
path: ./integration-release-action | ||
- name: Notify Release | ||
uses: ./integration-release-action | ||
with: | ||
# The integration identifier will be used by the Packer team to register the integration | ||
# the expected format is packer/<GitHub Org Name>/<plugin-name> | ||
integration_identifier: "packer/digitalocean/digitalocean" | ||
release_version: ${{ github.event.inputs.version }} | ||
release_sha: ${{ github.event.inputs.branch }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Notify Integration Release (Tag) | ||
on: | ||
push: | ||
tags: | ||
- '*.*.*' # Proper releases | ||
jobs: | ||
strip-version: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
packer-version: ${{ steps.strip.outputs.packer-version }} | ||
steps: | ||
- name: Strip leading v from version tag | ||
id: strip | ||
env: | ||
REF: ${{ github.ref_name }} | ||
run: | | ||
echo "packer-version=$(echo "$REF" | sed -E 's/v?([0-9]+\.[0-9]+\.[0-9]+)/\1/')" >> "$GITHUB_OUTPUT" | ||
notify-release: | ||
needs: | ||
- strip-version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout this repo | ||
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | ||
with: | ||
ref: ${{ github.ref }} | ||
# Ensure that Docs are Compiled | ||
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 | ||
- shell: bash | ||
run: make generate | ||
- shell: bash | ||
run: | | ||
if [[ -z "$(git status -s)" ]]; then | ||
echo "OK" | ||
else | ||
echo "Docs have been updated, but the compiled docs have not been committed." | ||
echo "Run 'make generate', and commit the result to resolve this error." | ||
exit 1 | ||
fi | ||
# Perform the Release | ||
- name: Checkout integration-release-action | ||
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | ||
with: | ||
repository: hashicorp/integration-release-action | ||
path: ./integration-release-action | ||
- name: Notify Release | ||
uses: ./integration-release-action | ||
with: | ||
# The integration identifier will be used by the Packer team to register the integration | ||
# the expected format is packer/<GitHub Org Name>/<plugin-name> | ||
integration_identifier: "packer/digitalocean/digitalocean" | ||
release_version: ${{ needs.strip-version.outputs.packer-version }} | ||
release_sha: ${{ github.ref }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
The [DigitalOcean](https://www.digitalocean.com/) Packer plugin provides a builder for building images in | ||
DigitalOcean, and a post-processor for importing already-existing images into | ||
DigitalOcean. | ||
|
||
|
||
### Installation | ||
|
||
To install this plugin, copy and paste this code into your Packer configuration, then run [`packer init`](https://www.packer.io/docs/commands/init). | ||
|
||
```hcl | ||
packer { | ||
required_plugins { | ||
digitalocean = { | ||
version = ">= 1.0.4" | ||
source = "github.com/digitalocean/digitalocean" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
Alternatively, you can use `packer plugins install` to manage installation of this plugin. | ||
|
||
```sh | ||
$ packer plugins install github.com/digitalocean/digitalocean | ||
``` | ||
|
||
### Components | ||
|
||
#### Builders | ||
|
||
- [digitalocean](/packer/integrations/digitalocean/digitalocean/latest/components/builder/digitalocean) - The builder takes a source image, runs any provisioning necessary on the image after launching it, then snapshots it into a reusable image. This reusable image can then be used as the foundation of new servers that are launched within DigitalOcean. | ||
|
||
#### Data Sources | ||
|
||
- [digitalocean-image](/packer/integrations/digitalocean/digitalocean/latest/components/datasource/image) - The DigitalOcean image data source is used look up the ID of an existing DigitalOcean image for use as a builder source. | ||
|
||
#### Post-processors | ||
|
||
- [digitalocean-import](/packer/integrations/digitalocean/digitalocean/latest/components/post-processor/import) -processor](/docs/post-processors/digitalocean-import.mdx) - The digitalocean-import post-processor is used to import images to DigitalOcean |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only initiate releases when there is a leading
v
in the tag. We should probably follow the same practice here.packer-plugin-digitalocean/.github/workflows/release.yml
Line 16 in 133cd62
That also raises a question for me about timing. If both our release workflow and the notify release are triggered by pushing a tag, it seems like we may notify you of the release before it has actually completed. Are there any concerns there? Would using the
release
trigger make sense here?https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefixing with a
v
looks good to me, we could probably adopt this for our plugins as well, though the regex does catch it as-is, hence the step to remove the leadingv
from the tag (the doc servers reject requests for versions with a trailingv
).For timing, we also do it in this order, and you're correct that the docs will be signalled as needing update before the release finished. In practice we haven't experienced problems (we scrape the docs from the tag, so the commit already exists and we can fetch the data), but we could indeed end-up with a release advertised on the docs site, even if the actual release process failed for some reason. Running this after the release has completed is probably a better idea indeed, and something we should do as well, thanks for the heads-up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. Thanks for looking into this. Let us know how the testing goes!