Procházet zdrojové kódy

DRY: put list of bubble scripts in one place, reference elsewhere

tags/v0.2.0
Jonathan Cobb před 5 roky
rodič
revize
c487b7f246
3 změnil soubory, kde provedl 24 přidání a 8 odebrání
  1. +1
    -1
      bin/prep_bubble_jar
  2. +6
    -7
      bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java
  3. +17
    -0
      bubble-server/src/main/resources/ansible/bubble_scripts.txt

+ 1
- 1
bin/prep_bubble_jar Zobrazit soubor

@@ -87,7 +87,7 @@ echo "------------------------------------------------------------"
cd ${LOCALSTORAGE_BASE_DIR} && jar uvf ${BUBBLE_JAR} automation || die "Error updating ${BUBBLE_JAR} with default role archives"

mkdir -p ${CLASSES_DIR}/scripts
for script in run.sh bubble_common bubble bget bgetn bgeti bpost bposte bput bpute bdelete bscript bmodel bencrypt bdecrypt list_bubble_databases cleanup_bubble_databases ; do
for script in $(cat ${BUBBLE_SERVER}/src/main/resources/ansible/bubble_scripts.txt) ; do
cp ${SCRIPT_DIR}/${script} ${CLASSES_DIR}/scripts || die "Error copying ${SCRIPT_DIR}/${script} -> ${CLASSES_DIR}/scripts"
done



+ 6
- 7
bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java Zobrazit soubor

@@ -46,8 +46,10 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;

import static bubble.ApiConstants.*;
import static bubble.ApiConstants.getRemoteHost;
import static bubble.ApiConstants.newNodeHostname;
import static bubble.dao.bill.AccountPlanDAO.PURCHASE_DELAY;
import static bubble.model.cloud.BubbleNode.TAG_ERROR;
import static bubble.server.BubbleConfiguration.DEBUG_NODE_INSTALL_FILE;
@@ -64,6 +66,7 @@ import static org.cobbzilla.util.io.FileUtil.*;
import static org.cobbzilla.util.io.StreamUtil.stream2string;
import static org.cobbzilla.util.json.JsonUtil.json;
import static org.cobbzilla.util.reflect.ReflectionUtil.closeQuietly;
import static org.cobbzilla.util.string.StringUtil.splitAndTrim;
import static org.cobbzilla.util.system.CommandShell.chmod;
import static org.cobbzilla.util.system.Sleep.sleep;
import static org.cobbzilla.wizard.resources.ResourceUtil.invalidEx;
@@ -80,12 +83,8 @@ public class StandardNetworkService implements NetworkService {
public static final String INSTALL_LOCAL_SH = "install_local.sh";
public static final String INSTALL_LOCAL_TEMPLATE = stream2string(ANSIBLE_DIR + "/" + INSTALL_LOCAL_SH + ".hbs");

public static final String[] BUBBLE_SCRIPTS = {
"run.sh", "bubble_common", "bubble",
"bget", "bpost", "bposte", "bput", "bpute", "bdelete",
"bscript", "bmodel", "bencrypt", "bdecrypt",
"list_bubble_databases", "cleanup_bubble_databases"
};
public static final List<String> BUBBLE_SCRIPTS = splitAndTrim(stream2string(ANSIBLE_DIR + "/bubble_scripts.txt"), "\n")
.stream().filter(s -> !empty(s)).collect(Collectors.toList());

public static final int MAX_ANSIBLE_TRIES = 5;
public static final int RESTORE_KEY_LEN = 6;


+ 17
- 0
bubble-server/src/main/resources/ansible/bubble_scripts.txt Zobrazit soubor

@@ -0,0 +1,17 @@
run.sh
bubble_common
bubble
bget
bgetn
bgeti
bpost
bposte
bput
bpute
bdelete
bscript
bmodel
bencrypt
bdecrypt
list_bubble_databases
cleanup_bubble_databases

Načítá se…
Zrušit
Uložit