hashicorp / packer

Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.

Home Page:http://www.packer.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add IPSW plugin

torarnv opened this issue · comments

Description

The IPSW data-source plugin can be used with HashiCorp Packer to fetch information about Apple device firmware, for example for building macOS images with Tart.

https://github.com/torarnv/packer-plugin-ipsw

Integration Tier

Checklist

  • Has valid metadata.hcl file in plugin repository.
  • Has added integration scripts packer-plugin-scaffolding 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.

The integration has been submitted in the past, and is listed here: https://developer.hashicorp.com/packer/integrations?components=data-source&filter=ipsw

But the docs link is broken, likely due to the new way that the docs are published.

https://github.com/torarnv/packer-plugin-ipsw/actions/runs/8204818234/job/22440273928

Shows Error: [validate-hcl] Error: Organization not found for integration identifier: 'packer/torarnv/ipsw'

I assume that's because the plugin hasn't been added to the docs yet?

I believe you helped me with this in the past @lbajolet-hashicorp

See #12541

Hi @torarnv,

It seems we have forgotten to include you in our round for integrations, apologies about that!

Good to see you've updated the docs structure, with the current docs I believe we'll be able to add them to the internal integrations (or update what exists at least), I'll see to this right now.

Thanks for signalling this to us!

Hi @torarnv,

You can try to run the integration action once again, on our side we did the updates to the documentation, this should work now

Thanks @lbajolet-hashicorp, the integration now worked. Do I need to do anything else? I see https://developer.hashicorp.com/packer/plugins/datasources/ipsw is still 404, but perhaps it takes a while to go live?

Does the integration automatically publish the new docs, or does it trigger a PR or something similar on your side?

Hi again! I can confirm your plugin is available, not on plugins anymore though (https://developer.hashicorp.com/packer/integrations/torarnv/ipsw), I'm surprised the link doesn't work anymore, there should be some redirect in place to avoid this problem, that's a discussion I need to have internally.
Also it seems that the documentation is not complete on the new system, I'm not sure why, I'll need to troubleshoot this. I'll make this a priority for Monday.

Thanks @lbajolet-hashicorp , no rush! 😄 Have a good weekend!

I'm looking at perhaps renaming this plugin to packer-plugin-appledb, as there are other releases one can fetch from https://appledb.dev/ than just IPSWs. For example Xcode releases. Github will apparently do redirects for git urls, so I assume this would work fine for someone with this in their packer config?

ipsw = {
       version = ">= 0.0.8"
       source = "github.com/torarnv/ipsw"
}
``

If that works fine, then let's hold on publishing the docs for this plugin until I've renamed it :)

Hi @torarnv,

No objection to you renaming the project, I'd think Github does redirect so there's a good chance users may be able to download it this way, that being said, I'm not completely certain the installation/loading logic will work if the source has one name, and the binary another (i.e. in this case the plugin source would be github.com/torarnv/ipsw and the plugin would be packer-plugin-appledb).

If you plan on using appledb for future versions of the plugin, I would encourage you instead to fork your ipsw plugin as appledb, update the ipsw plugin to state that it's deprecated/will not be maintained, and point to appledb as replacement.
This advisory message can be part of the docs and the plugin itself (though I'm not certain datasources can print messages to users, if it's in the verbose logs, chances are it won't be super visible).

In any case, the fact that the main docs and the datasources aren't visible most likely point to a problem with our configuration, so I'll take a look this way, and let you know if there's something to change in your repo, this fix will likely be applicable to both plugins.

Hi again @torarnv,

I just opened torarnv/packer-plugin-ipsw#1, this removes an invalid flag from the metadata. This invalid flag prevented the ingestion of the payload sent by the publication earlier, hence why we're seeing an empty documentation for the plugin at the moment.

Once merged, you'll need to run the ingestion action once more (no need to bump the release number, it can still be 0.0.12), this will re-trigger the ingestion, and provided there are no other errors, the docs should get updated.

I've also opened a PR internally to enable the redirection from the old URIs, this way links like the one you shared above should work again.

Ah, awesome, thank you so much @lbajolet-hashicorp !

Very true, the scaffolding HCL file is indeed wrong, thanks for the notice! I'll fix that immediately.

Oh also FYI the old URIs should work too in addition to the new one, I fixed the redirections for your plugin, so now the old links will redirect you to the new docs

Awesome!! I think we can close this one then, thanks for all your help, it makes working with Packer a joy <3