How to update artifact from git repo


I’ve met some troubles with updating artifact placed in git repo.
Artifact itself is directory with alerting rules for vmalert. Nomad job was created and deployed by terraform from template file.

After trying to recreate and redeploy Nomad job artifact hasn’t changed.

How can I trigger artifact update?
Nomad v1.3.5

Hi @d.kondidatov,

After trying to recreate and redeploy Nomad job artifact hasn’t changed.

Could you explain a little more about this process?

In order for Nomad to recognise a change, the artifact should use some form of versioning which is updated every time new changes are made and ready for deployment. This new version can then be reflected in an update to the artifact source or options job specification parameters; and then deployed to Nomad as a job registration update.

jrasell and the Nomad team


This is how my stanza looks.

 artifact {
         source      = ""
         destination = "\u0024{NOMAD_TASK_DIR}/alerts"
         options {
           sshkey = "${base64encode(file(pathexpand("~/.ssh/id_rsa")))}"
           ref = "${git_branch}"

What I have:

  • git repo with alert rules;
  • deployed nomad job.

What I want:

  • update alerts in file in git repo;
  • put it in the nomad job.

What I did:

  • I pushed new file to the main branch in repo;
  • terraform apply -recreate=“nomad job template”;
  • terraform apply -recreate=“nomad job deployment”

Nomad job was redeployed but with previous one version of the rule file.

What should I add to the artifact stanza if I want to use the latest commit as an artifact?

So, I figured out how is it works.

The problem was related to the same nomad.job file each time. It had not any changes when it was applied and that is why artifact wasn’t reloaded also.

The solution (kinda workaround) in my case is make some of job config unique for each template generating, so it will be “new version” for each apply and will trigger artifact downloading on each apply.