diff --git a/bin/prep_bubble_jar b/bin/prep_bubble_jar index 1c8b1345..11b44010 100755 --- a/bin/prep_bubble_jar +++ b/bin/prep_bubble_jar @@ -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 diff --git a/bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java b/bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java index a8a917ec..b8831143 100644 --- a/bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java +++ b/bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java @@ -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 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; diff --git a/bubble-server/src/main/resources/ansible/bubble_scripts.txt b/bubble-server/src/main/resources/ansible/bubble_scripts.txt new file mode 100644 index 00000000..207a3238 --- /dev/null +++ b/bubble-server/src/main/resources/ansible/bubble_scripts.txt @@ -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