diff --git a/setup_stage1.sh b/setup_stage1.sh index c7c00710..b51a3fd5 100755 --- a/setup_stage1.sh +++ b/setup_stage1.sh @@ -73,16 +73,16 @@ function generate_stage1_ipxe_scripts() { # Create all stage1.ipxe scripts. pushd ${build_dir} # TODO: replace host set with metadata service. - test -d operator || git clone https://github.com/m-lab/operator - pushd operator/plsync - mkdir -p ${output_dir} - ./mlabconfig.py --format=server-network-config \ - --physical \ - --select "${hostname_pattern}" \ - --label "project=${PROJECT}" \ - --template_input "${config_dir}/stage1-template.ipxe" \ - --template_output "${output_dir}/stage1-{{hostname}}.ipxe" - popd + # TODO: Replace curl with a native go-get once mlabconfig is rewritten in Go. + curl --location "https://raw.githubusercontent.com/m-lab/siteinfo/master/cmd/mlabconfig.py" > \ + ./mlabconfig.py + mkdir -p ${output_dir} + python ./mlabconfig.py --format=server-network-config \ + --physical \ + --select "${hostname_pattern}" \ + --label "project=${PROJECT}" \ + --template_input "${config_dir}/stage1-template.ipxe" \ + --template_output "${output_dir}/stage1-{{hostname}}.ipxe" popd } diff --git a/setup_stage1_isos.sh b/setup_stage1_isos.sh index 6b2b5f5e..4111cd43 100755 --- a/setup_stage1_isos.sh +++ b/setup_stage1_isos.sh @@ -22,17 +22,16 @@ set -xuo pipefail # Use mlabconfig to fill in the template for every machine matching the given # HOSTNAMES pattern. pushd ${BUILD_DIR} - test -d operator || git clone https://github.com/m-lab/operator - pushd operator/plsync - mkdir -p ${OUTPUT_DIR}/scripts - ./mlabconfig.py --format=server-network-config \ - --physical \ - --select "${HOSTNAMES}" \ - --label "project=${PROJECT}" \ - --template_input "${CONFIG_DIR}/create-stage1-iso-template.sh" \ - --template_output "${BUILD_DIR}/create-stage1-iso-{{hostname}}.sh" - popd -popd + # TODO: Replace curl with a native go-get once mlabconfig is rewritten in Go. + curl --location "https://raw.githubusercontent.com/m-lab/siteinfo/master/cmd/mlabconfig.py" > \ + ./mlabconfig.py + mkdir -p ${OUTPUT_DIR}/scripts + python ./mlabconfig.py --format=server-network-config \ + --physical \ + --select "${HOSTNAMES}" \ + --label "project=${PROJECT}" \ + --template_input "${CONFIG_DIR}/create-stage1-iso-template.sh" \ + --template_output "${BUILD_DIR}/create-stage1-iso-{{hostname}}.sh" # Check whether there are any files in the glob pattern. if ! compgen -G ${BUILD_DIR}/create-stage1-iso-*.sh ; then diff --git a/setup_stage1_usbs.sh b/setup_stage1_usbs.sh index 112becb3..ee5e9292 100755 --- a/setup_stage1_usbs.sh +++ b/setup_stage1_usbs.sh @@ -23,16 +23,16 @@ set -xuo pipefail # Use mlabconfig to fill in the template for every machine matching the given # HOSTNAMES pattern. pushd "${BUILD_DIR}" - test -d operator || git clone https://github.com/m-lab/operator - pushd operator/plsync - mkdir -p "${OUTPUT_DIR}/scripts" - ./mlabconfig.py --format=server-network-config \ - --physical \ - --select "${HOSTNAMES}" \ - --label "project=${PROJECT}" \ - --template_input "${CONFIG_DIR}/create-stage1-usb-template.sh" \ - --template_output "${BUILD_DIR}/create-stage1-usb-{{hostname}}.sh" - popd + # TODO: Replace curl with a native go-get once mlabconfig is rewritten in Go. + curl --location "https://raw.githubusercontent.com/m-lab/siteinfo/master/cmd/mlabconfig.py" > \ + ./mlabconfig.py + mkdir -p "${OUTPUT_DIR}/scripts" + python ./mlabconfig.py --format=server-network-config \ + --physical \ + --select "${HOSTNAMES}" \ + --label "project=${PROJECT}" \ + --template_input "${CONFIG_DIR}/create-stage1-usb-template.sh" \ + --template_output "${BUILD_DIR}/create-stage1-usb-{{hostname}}.sh" popd # Check whether there are any files in the glob pattern.