Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add artifact support for HCP Packer registry #190

Merged
merged 2 commits into from
Jun 7, 2022

Conversation

optik-aper
Copy link
Member

@optik-aper optik-aper commented Jun 6, 2022

Description

Working off of the official documentation (https://www.packer.io/docs/plugins/hcp-support). This should now allow utilization of the hcp_packer_registry block (https://www.packer.io/docs/templates/hcl_templates/blocks/build/hcp_packer_registry) and support adding Vultr snapshots to the HCP Packer registry.

Related Issues

#189

Testing

packer {
  required_plugins {
  }
}

build {
  hcp_packer_registry {
    bucket_name = "test-almalinux-3"
    description = "some description"
    bucket_labels = {
      "owner" = "platform-team"
    }

    build_labels = {
      "build-time"   = timestamp()
      "build-source" = basename(path.cwd)
    }
  }

  sources = [
    "source.vultr.almalinux",
  ]

  provisioner "shell" {
    inline = [
      "echo hello",
    ]
  }
}

variable "vultr_api_key" {
  type    = string
  default = "${env("VULTR_API_KEY")}"
}

source "vultr" "almalinux" {
  api_key              = "${var.vultr_api_key}"
  os_id                = "452"
  plan_id              = "vc2-1c-1gb"
  region_id            = "lax"
  snapshot_description = "testing"
  state_timeout        = "10m"
  ssh_username         = "root"
}

Checklist:

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you linted your code locally prior to submission?
  • Have you successfully ran tests with your changes locally?

Working off of the official documentation
(https://www.packer.io/docs/plugins/hcp-support).  This should now allow
utilization of the hcp_packer_registry block
(https://www.packer.io/docs/templates/hcl_templates/blocks/build/hcp_packer_registry)
and support adding Vultr snapshots to the HCP Packer registry.
@optik-aper optik-aper added the enhancement New feature or request label Jun 6, 2022
@optik-aper optik-aper requested a review from ddymko June 6, 2022 20:57
Copy link
Contributor

@ddymko ddymko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ddymko ddymko merged commit f946843 into vultr:master Jun 7, 2022
@optik-aper optik-aper mentioned this pull request Jun 7, 2022
3 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants