Skip to content
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

External pack dependency expects pack in deps subdirectory #255

Open
tcassaert opened this issue Jun 1, 2022 · 3 comments
Open

External pack dependency expects pack in deps subdirectory #255

tcassaert opened this issue Jun 1, 2022 · 3 comments

Comments

@tcassaert
Copy link

Following the https://github.com/hashicorp/nomad-pack/blob/main/docs/writing-packs.md guide, I was trying to load a helper template from a pack that's defined as a dependency.

metadata.hcl

app {
  url    = "https://git.tcassaert.com/homelab"
  author = "tcassaert"
}

pack {
  name        = "backup_job"
  description = "A Nomad Pack for Homelab backup jobs"
  url         = "https://git.tcassaert.com/tcassaert/nomad-packs/backup_job"
  version     = "0.0.1"
}

dependency "helpers" {
  source = "ssh://git@git.tcassaert.com:2222/tcassaert/nomad-packs/packs/helpers"
}

When I try to render my pack, I'm getting the following, even without trying to use anything from the dependency yet:

! Failed To Process Pack

        Error:   failed to load pack dependency: failed to load dependent pack: stat /home/tcassaert/private/gitea/nomad-packs/packs/backup_job/deps/helpers: no such
file or directory
        Type:    *errors.errorString
        Context:
                 - Registry Name: <<local folder>>
                 - Pack Name: backup_job
                 - Pack Ref: <<none>>
                 - Pack Path: /home/tcassaert/private/gitea/nomad-packs/packs/backup_job

When I do add the dependency in the deps subdirectory, it doesn't seem to find the helper template that I try to use, but maybe that's for another issue.

@dani
Copy link

dani commented Jul 30, 2023

Any clarification about how to use dependencies ?

@slonopotamus
Copy link
Contributor

You need to run nomad-pack deps vendor. It will download dependencies listed in metadata.hcl and put them in deps directory.

@dani
Copy link

dani commented Aug 12, 2023

OK, couldn't find this in the doc. Will try asap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants