@@ -165,6 +165,7 @@ public class BubbleConfiguration extends PgRestServerConfiguration | |||||
public boolean hasSageNode () { return getSageNode() != null; } | public boolean hasSageNode () { return getSageNode() != null; } | ||||
@Getter @Setter private String letsencryptEmail; | @Getter @Setter private String letsencryptEmail; | ||||
@Getter @Setter private String releaseUrlBase; | |||||
@Setter private String localStorageDir = DEFAULT_LOCAL_STORAGE_DIR; | @Setter private String localStorageDir = DEFAULT_LOCAL_STORAGE_DIR; | ||||
public String getLocalStorageDir () { return empty(localStorageDir) ? DEFAULT_LOCAL_STORAGE_DIR : localStorageDir; } | public String getLocalStorageDir () { return empty(localStorageDir) ? DEFAULT_LOCAL_STORAGE_DIR : localStorageDir; } | ||||
@@ -42,6 +42,7 @@ import static bubble.ApiConstants.copyScripts; | |||||
import static bubble.model.cloud.RegionalServiceDriver.findClosestRegions; | import static bubble.model.cloud.RegionalServiceDriver.findClosestRegions; | ||||
import static bubble.service.packer.PackerService.*; | import static bubble.service.packer.PackerService.*; | ||||
import static org.cobbzilla.util.daemon.ZillaRuntime.*; | import static org.cobbzilla.util.daemon.ZillaRuntime.*; | ||||
import static org.cobbzilla.util.http.HttpUtil.url2string; | |||||
import static org.cobbzilla.util.io.FileUtil.*; | import static org.cobbzilla.util.io.FileUtil.*; | ||||
import static org.cobbzilla.util.io.StreamUtil.copyClasspathDirectory; | import static org.cobbzilla.util.io.StreamUtil.copyClasspathDirectory; | ||||
import static org.cobbzilla.util.io.StreamUtil.stream2string; | import static org.cobbzilla.util.io.StreamUtil.stream2string; | ||||
@@ -157,6 +158,19 @@ public class PackerJob implements Callable<List<PackerImage>> { | |||||
// copy ansible and other packer files to temp dir | // copy ansible and other packer files to temp dir | ||||
@Cleanup final TempDir tempDir = copyClasspathDirectory("packer"); | @Cleanup final TempDir tempDir = copyClasspathDirectory("packer"); | ||||
final String releaseUrlBase = configuration.getReleaseUrlBase(); | |||||
// create var for algo_sha256 | |||||
final String algoVarsDir = abs(tempDir) + "/roles/algo/vars"; | |||||
mkdirOrDie(algoVarsDir); | |||||
final String algoHash = url2string(releaseUrlBase+"/algo/latest/algo.zip.sha256"); | |||||
FileUtil.toFileOrDie(new File(algoVarsDir, "main.yml"), "algo_sha256 : '"+algoHash+"'"); | |||||
// create var for mitmproxy_sha256 | |||||
final String mitmproxyVarsDir = abs(tempDir) + "/roles/mitmproxy/vars"; | |||||
mkdirOrDie(mitmproxyVarsDir); | |||||
final String mitmproxyHash = url2string(releaseUrlBase+"/mitmproxy/latest/mitmproxy.zip.sha256"); | |||||
FileUtil.toFileOrDie(new File(mitmproxyVarsDir, "main.yml"), "mitmproxy_sha256 : '"+mitmproxyHash+"'"); | |||||
// copy packer ssh key | // copy packer ssh key | ||||
copyFile(packerService.getPackerPublicKey(), new File(abs(tempDir)+"/roles/common/files/"+PACKER_KEY_NAME)); | copyFile(packerService.getPackerPublicKey(), new File(abs(tempDir)+"/roles/common/files/"+PACKER_KEY_NAME)); | ||||
@@ -76,6 +76,7 @@ localNotificationStrategy: {{#exists BUBBLE_LOCAL_NOTIFY}}{{BUBBLE_LOCAL_NOTIFY} | |||||
letsencryptEmail: {{LETSENCRYPT_EMAIL}} | letsencryptEmail: {{LETSENCRYPT_EMAIL}} | ||||
localStorageDir: {{LOCALSTORAGE_BASE_DIR}} | localStorageDir: {{LOCALSTORAGE_BASE_DIR}} | ||||
releaseUrlBase: {{#exists BUBBLE_RELEASE_URL_BASE}}{{BUBBLE_RELEASE_URL_BASE}}{{else}}https://jenkins.bubblev.org/public/releases{{/exists}} | |||||
disallowedCountries: {{DISALLOWED_COUNTRIES}} | disallowedCountries: {{DISALLOWED_COUNTRIES}} | ||||
@@ -11,9 +11,9 @@ | |||||
- name: Download algo dist file | - name: Download algo dist file | ||||
get_url: | get_url: | ||||
url: https://github.com/getbubblenow/bubble-dist/raw/master/algo/master.zip | |||||
url: https://jenkins.bubblev.org/public/releases/latest/algo/algo.zip | |||||
dest: /tmp/algo.zip | dest: /tmp/algo.zip | ||||
checksum: sha256:0c32e213ff4cfd807718cb276f6160d4b587779c94fba2c2102905b7303720f8 | |||||
checksum: sha256:{{ algo_sha256 }} | |||||
- name: Unzip algo master.zip | - name: Unzip algo master.zip | ||||
unarchive: | unarchive: | ||||
@@ -39,9 +39,9 @@ | |||||
- name: Download mitmproxy dist file | - name: Download mitmproxy dist file | ||||
get_url: | get_url: | ||||
url: https://github.com/getbubblenow/bubble-dist/raw/master/mitmproxy/mitmproxy.zip | |||||
url: https://jenkins.bubblev.org/public/releases/latest/mitmproxy/mitmproxy.zip | |||||
dest: /tmp/mitmproxy.zip | dest: /tmp/mitmproxy.zip | ||||
checksum: sha256:eebde85f9d49f34634695c3e3916f5940a31e5393d52d3f2df793a2a4f9f6430 | |||||
checksum: sha256:{{ mitmproxy_sha256 }} | |||||
- name: Unzip mitmproxy.zip | - name: Unzip mitmproxy.zip | ||||
unarchive: | unarchive: | ||||