From b1f17512014b909d184518cbab79d1b52b4fd616 Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Tue, 15 Sep 2020 14:42:07 -0400 Subject: [PATCH] write version and hashes to bubble version properties file --- .../src/main/java/bubble/service/packer/PackerJob.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bubble-server/src/main/java/bubble/service/packer/PackerJob.java b/bubble-server/src/main/java/bubble/service/packer/PackerJob.java index 0d5bd80e..b1378661 100644 --- a/bubble-server/src/main/java/bubble/service/packer/PackerJob.java +++ b/bubble-server/src/main/java/bubble/service/packer/PackerJob.java @@ -299,7 +299,12 @@ public class PackerJob implements Callable> { final File varsDir = mkdirOrDie(abs(tempDir) + "/roles/"+ROLE_BUBBLE+"/vars"); final StringBuilder b = new StringBuilder(); for (Map.Entry var : versions.entrySet()) { - b.append(var.getKey().replace("-", "_")).append(" : '").append(var.getValue().trim()).append("'\n"); + final String roleName = var.getKey(); + final String version = var.getValue().trim(); + final String roleBase = roleName.replace("-", "_"); + final String hash = packerService.getSoftwareHash(roleName, version); + b.append(roleBase).append("_version : '").append(version).append("'\n") + .append(roleBase).append("_sha : '").append(hash).append("'\n"); } FileUtil.toFileOrDie(new File(varsDir, "main.yml"), b.toString()); }