From 96633a073d667e0d355a35f1402c3ea47be6e827 Mon Sep 17 00:00:00 2001 From: Roman Storm Date: Wed, 22 Nov 2017 21:21:00 -0800 Subject: [PATCH] PROBLEM: Impossible to fork the repo and test new code Solution: Move hardcoded oraclesorg from all strings to a common.vars variable --- nodes/bootnode/install.sh | 11 ++++++----- nodes/bootnode/template.json | 2 +- nodes/common.vars | 1 + nodes/mining-node/install.sh | 7 ++++--- nodes/mining-node/template.json | 2 +- nodes/netstats-server/install.sh | 5 +++-- nodes/netstats-server/template.json | 2 +- nodes/owner/install.sh | 7 ++++--- nodes/owner/template.json | 2 +- 9 files changed, 22 insertions(+), 17 deletions(-) diff --git a/nodes/bootnode/install.sh b/nodes/bootnode/install.sh index e534acb..85b07cf 100644 --- a/nodes/bootnode/install.sh +++ b/nodes/bootnode/install.sh @@ -5,6 +5,7 @@ set -x # this should be provided through env by azure template TEMPLATES_BRANCH="${TEMPLATES_BRANCH}" +MAIN_REPO_FETCH="${MAIN_REPO_FETCH}" echo "========== ${TEMPLATES_BRANCH}/bootnode/install.sh starting ==========" echo "===== current time: $(date)" @@ -19,7 +20,7 @@ EXT_IP="$(curl ifconfig.co)" echo "===== external ip: ${EXT_IP}" echo "===== downloading common.vars" -curl -sLO "https://raw.githubusercontent.com/oraclesorg/deployment-azure/${TEMPLATES_BRANCH}/nodes/common.vars" +curl -sLO "https://raw.githubusercontent.com/${MAIN_REPO_FETCH}/deployment-azure/${TEMPLATES_BRANCH}/nodes/common.vars" source common.vars INSTALL_CONFIG_REPO="${REPO_BASE_PATH}/bootnode" @@ -38,7 +39,7 @@ echo "===== environmental variables:" printenv echo "===== downloading common.funcs" -curl -sLO "https://raw.githubusercontent.com/oraclesorg/deployment-azure/${TEMPLATES_BRANCH}/nodes/common.funcs" +curl -sLO "https://raw.githubusercontent.com/${MAIN_REPO_FETCH}/deployment-azure/${TEMPLATES_BRANCH}/nodes/common.funcs" source common.funcs setup_ufw() { @@ -74,9 +75,9 @@ EOF clone_dapps() { echo "=====> clone_dapps" mkdir -p parity_data/dapps - git clone -b ${DAPPS_BRANCH} --single-branch https://github.com/oraclesorg/oracles-dapps-keys-generation.git parity_data/dapps/KeysGenerator - git clone -b ${DAPPS_BRANCH} --single-branch https://github.com/oraclesorg/oracles-dapps-voting.git parity_data/dapps/Voting - git clone -b ${DAPPS_BRANCH} --single-branch https://github.com/oraclesorg/oracles-dapps-validators.git parity_data/dapps/ValidatorsList + git clone -b ${DAPPS_BRANCH} --single-branch https://github.com/${MAIN_REPO_FETCH}/oracles-dapps-keys-generation.git parity_data/dapps/KeysGenerator + git clone -b ${DAPPS_BRANCH} --single-branch https://github.com/${MAIN_REPO_FETCH}/oracles-dapps-voting.git parity_data/dapps/Voting + git clone -b ${DAPPS_BRANCH} --single-branch https://github.com/${MAIN_REPO_FETCH}/oracles-dapps-validators.git parity_data/dapps/ValidatorsList echo "<===== clone_dapps" } diff --git a/nodes/bootnode/template.json b/nodes/bootnode/template.json index 12d51a2..cfd28f1 100644 --- a/nodes/bootnode/template.json +++ b/nodes/bootnode/template.json @@ -237,7 +237,7 @@ "autoUpgradeMinorVersion": true, "settings": { "fileUris": [ - "[concat('https://raw.githubusercontent.com/oraclesorg/deployment-azure/', variables('TEMPLATES_BRANCH'), '/nodes/bootnode/install.sh')]" + "[concat('https://raw.githubusercontent.com/', variables('MAIN_REPO_FETCH'), '/deployment-azure/', variables('TEMPLATES_BRANCH'), '/nodes/bootnode/install.sh')]" ] }, "protectedSettings": { diff --git a/nodes/common.vars b/nodes/common.vars index 6ba7327..1e2c4a9 100644 --- a/nodes/common.vars +++ b/nodes/common.vars @@ -3,6 +3,7 @@ echo "=====> sourcing common.vars" ##### These variables may need to be changed when creating new network OWNER_ADDRESS="0xdd0bb0e2a1594240fed0c2f2c17c1e9ab4f87126" +MAIN_REPO_FETCH="oraclesorg" SCRIPTS_BRANCH="sokol" DAPPS_BRANCH="master" diff --git a/nodes/mining-node/install.sh b/nodes/mining-node/install.sh index 23ecd16..b28cfbf 100644 --- a/nodes/mining-node/install.sh +++ b/nodes/mining-node/install.sh @@ -5,6 +5,7 @@ set -x # this should be provided through env by azure template TEMPLATES_BRANCH="${TEMPLATES_BRANCH}" +MAIN_REPO_FETCH="${MAIN_REPO_FETCH}" echo "========== ${TEMPLATES_BRANCH}/mining-node/install.sh starting ==========" echo "===== current time: $(date)" @@ -19,7 +20,7 @@ EXT_IP="$(curl ifconfig.co)" echo "===== external ip: ${EXT_IP}" echo "===== downloading common.vars" -curl -sLO "https://raw.githubusercontent.com/oraclesorg/deployment-azure/${TEMPLATES_BRANCH}/nodes/common.vars" +curl -sLO "https://raw.githubusercontent.com/${MAIN_REPO_FETCH}/deployment-azure/${TEMPLATES_BRANCH}/nodes/common.vars" source common.vars INSTALL_CONFIG_REPO="${REPO_BASE_PATH}/mining-node" @@ -42,7 +43,7 @@ echo "===== environmental variables:" printenv echo "===== downloading common.funcs" -curl -sLO "https://raw.githubusercontent.com/oraclesorg/deployment-azure/${TEMPLATES_BRANCH}/nodes/common.funcs" +curl -sLO "https://raw.githubusercontent.com/${MAIN_REPO_FETCH}/deployment-azure/${TEMPLATES_BRANCH}/nodes/common.funcs" source common.funcs set_ssh_keys() { @@ -100,7 +101,7 @@ EOF install_scripts() { echo "=====> install_scripts" - git clone -b ${SCRIPTS_BRANCH} --single-branch https://github.com/oraclesorg/oracles-scripts + git clone -b ${SCRIPTS_BRANCH} --single-branch https://github.com/${MAIN_REPO_FETCH}/oracles-scripts ln -s ../${NODE_TOML} oracles-scripts/node.toml cd oracles-scripts/scripts npm install diff --git a/nodes/mining-node/template.json b/nodes/mining-node/template.json index 019dca8..9fa86b4 100644 --- a/nodes/mining-node/template.json +++ b/nodes/mining-node/template.json @@ -243,7 +243,7 @@ "autoUpgradeMinorVersion": true, "settings": { "fileUris": [ - "[concat('https://raw.githubusercontent.com/oraclesorg/deployment-azure/', variables('TEMPLATES_BRANCH'), '/nodes/mining-node/install.sh')]" + "[concat('https://raw.githubusercontent.com/', variables('MAIN_REPO_FETCH'), '/deployment-azure/', variables('TEMPLATES_BRANCH'), '/nodes/mining-node/install.sh')]" ] }, "protectedSettings": { diff --git a/nodes/netstats-server/install.sh b/nodes/netstats-server/install.sh index b624b4d..06b71b8 100644 --- a/nodes/netstats-server/install.sh +++ b/nodes/netstats-server/install.sh @@ -5,6 +5,7 @@ set -x # this should be provided through env by azure template TEMPLATES_BRANCH="${TEMPLATES_BRANCH}" +MAIN_REPO_FETCH="${MAIN_REPO_FETCH}" echo "========== ${TEMPLATES_BRANCH}/netstats-server/install.sh starting ==========" echo "===== current time: $(date)" @@ -19,7 +20,7 @@ EXT_IP="$(curl ifconfig.co)" echo "===== external ip: ${EXT_IP}" echo "===== downloading common.vars" -curl -sLO "https://raw.githubusercontent.com/oraclesorg/deployment-azure/${TEMPLATES_BRANCH}/nodes/common.vars" +curl -sLO "https://raw.githubusercontent.com/${MAIN_REPO_FETCH}/deployment-azure/${TEMPLATES_BRANCH}/nodes/common.vars" source common.vars INSTALL_CONFIG_REPO="${REPO_BASE_PATH}/netstats-server" @@ -38,7 +39,7 @@ echo "===== environmental variables:" printenv echo "===== downloading common.funcs" -curl -sLO "https://raw.githubusercontent.com/oraclesorg/deployment-azure/${TEMPLATES_BRANCH}/nodes/common.funcs" +curl -sLO "https://raw.githubusercontent.com/${MAIN_REPO_FETCH}/deployment-azure/${TEMPLATES_BRANCH}/nodes/common.funcs" source common.funcs setup_ufw() { diff --git a/nodes/netstats-server/template.json b/nodes/netstats-server/template.json index 688dae1..da8af0f 100644 --- a/nodes/netstats-server/template.json +++ b/nodes/netstats-server/template.json @@ -230,7 +230,7 @@ "autoUpgradeMinorVersion": true, "settings": { "fileUris": [ - "[concat('https://raw.githubusercontent.com/oraclesorg/deployment-azure/', variables('TEMPLATES_BRANCH'), '/nodes/netstats-server/install.sh')]" + "[concat('https://raw.githubusercontent.com/',variables('MAIN_REPO_FETCH'),'/deployment-azure/', variables('TEMPLATES_BRANCH'), '/nodes/netstats-server/install.sh')]" ] }, "protectedSettings": { diff --git a/nodes/owner/install.sh b/nodes/owner/install.sh index ea9ac12..ab6e233 100644 --- a/nodes/owner/install.sh +++ b/nodes/owner/install.sh @@ -5,6 +5,7 @@ set -x # this should be provided through env by azure template TEMPLATES_BRANCH="${TEMPLATES_BRANCH}" +MAIN_REPO_FETCH="${MAIN_REPO_FETCH}" echo "========== ${TEMPLATES_BRANCH}/owner/install.sh starting ==========" echo "===== current time: $(date)" @@ -19,7 +20,7 @@ EXT_IP="$(curl ifconfig.co)" echo "===== external ip: ${EXT_IP}" echo "===== downloading common.vars" -curl -sLO "https://raw.githubusercontent.com/oraclesorg/deployment-azure/${TEMPLATES_BRANCH}/nodes/common.vars" +curl -sLO "https://raw.githubusercontent.com/${MAIN_REPO_FETCH}/deployment-azure/${TEMPLATES_BRANCH}/nodes/common.vars" source common.vars INSTALL_CONFIG_REPO="${REPO_BASE_PATH}/owner" @@ -40,7 +41,7 @@ echo "===== environmental variables:" printenv echo "===== downloading common.funcs" -curl -sLO "https://raw.githubusercontent.com/oraclesorg/deployment-azure/${TEMPLATES_BRANCH}/nodes/common.funcs" +curl -sLO "https://raw.githubusercontent.com/${MAIN_REPO_FETCH}/deployment-azure/${TEMPLATES_BRANCH}/nodes/common.funcs" source common.funcs setup_ufw() { @@ -84,7 +85,7 @@ EOF download_initial_keys_script() { echo "=====> download_initial_keys_script" - git clone -b ${IKEYS_BRANCH} --single-branch https://github.com/oraclesorg/oracles-initial-keys + git clone -b ${IKEYS_BRANCH} --single-branch https://github.com/${MAIN_REPO_FETCH}/oracles-initial-keys cd oracles-initial-keys npm install cd .. diff --git a/nodes/owner/template.json b/nodes/owner/template.json index 668c2da..16880dc 100644 --- a/nodes/owner/template.json +++ b/nodes/owner/template.json @@ -235,7 +235,7 @@ "autoUpgradeMinorVersion": true, "settings": { "fileUris": [ - "[concat('https://raw.githubusercontent.com/oraclesorg/deployment-azure/', variables('TEMPLATES_BRANCH'), '/nodes/owner/install.sh')]" + "[concat('https://raw.githubusercontent.com/', variables('MAIN_REPO_FETCH'), '/deployment-azure/', variables('TEMPLATES_BRANCH'), '/nodes/owner/install.sh')]" ] }, "protectedSettings": {