diff --git a/infra/docker/metagraph-ubuntu/Dockerfile b/infra/docker/metagraph-ubuntu/Dockerfile index 56cb554..78c4c78 100755 --- a/infra/docker/metagraph-ubuntu/Dockerfile +++ b/infra/docker/metagraph-ubuntu/Dockerfile @@ -27,7 +27,7 @@ RUN apt-get update && \ RUN git clone https://github.com/Constellation-Labs/tessellation.git && \ cd tessellation && \ git checkout $CHECKOUT_TESSELLATION_VERSION && \ - rm -r version.sbt && \ + rm -rf version.sbt && \ echo "ThisBuild / version := \"$TESSELLATION_VERSION_SEMVER\"" > version.sbt RUN cd tessellation && \ diff --git a/scripts/hydra b/scripts/hydra index 0e9b7f4..0c14323 100755 --- a/scripts/hydra +++ b/scripts/hydra @@ -76,7 +76,8 @@ function install() { # @cmd Installs a project from templates # @arg name Project name -# @option --repo Project repositor (default https://github.com/Constellation-Labs/metagraph-examples.git) +# @option --repo Project repository (default https://github.com/Constellation-Labs/metagraph-examples.git) +# @option --branch Repository branch (default default_branch) # @option --path Template path on repository (default examples) # @flag --list List available templates function install-template() { diff --git a/scripts/hydra-operations/install-template.sh b/scripts/hydra-operations/install-template.sh index a1ccec4..657d2ce 100755 --- a/scripts/hydra-operations/install-template.sh +++ b/scripts/hydra-operations/install-template.sh @@ -10,9 +10,15 @@ function install_template() { rm -r -f $INFRA_PATH/$repo_name git clone --quiet $argc_repo >/dev/null + if [ "${argc_branch}" ]; then + echo_yellow "Using branch ${argc_branch}" + cd $INFRA_PATH/$repo_name + git checkout --quiet $argc_branch >/dev/null + cd ../ + fi + echo_yellow "" - echo_yellow "Available templates" - echo_green "" + echo_green "=== Available Templates ===" ls -1 $INFRA_PATH/$repo_name/$argc_path rm -rf $INFRA_PATH/$repo_name @@ -22,21 +28,29 @@ function install_template() { fi if [ -z "${argc_name}" ]; then - echo_red "You should provide the repository name" + echo_red "You must provide a repository name" exit 1 fi - echo_green "##########################################" + echo_url "=== Template Details ===" echo_url "Project name:" $argc_name echo_url "Repository URL:" $argc_repo echo_url "Repository Name:" $repo_name echo_url "Path:" $argc_path - echo_green "##########################################" cd $INFRA_PATH rm -r -f $INFRA_PATH/$repo_name git clone --quiet $argc_repo >/dev/null + if [ "${argc_branch}" ]; then + echo_url "Branch: " $argc_branch + cd $INFRA_PATH/$repo_name + git checkout --quiet $argc_branch >/dev/null + cd ../ + fi + + echo_green "" + echo_white "Checking if the template exists on repository..." PROJECT_DIRECTORY=$repo_name/$argc_path/$argc_name if [ ! -d "$PROJECT_DIRECTORY" ]; then @@ -71,5 +85,6 @@ function install_template() { rm -r .git fi - + echo_green "" + echo_url "Template installed: " $argc_name } diff --git a/scripts/hydra-operations/update.sh b/scripts/hydra-operations/update.sh index f28de1c..ae82621 100755 --- a/scripts/hydra-operations/update.sh +++ b/scripts/hydra-operations/update.sh @@ -24,6 +24,7 @@ function check_if_should_update() { echo "Directory - scripts" echo "Directory - infra/ansible/local/playbooks/start" echo "Directory - infra/ansible/local/playbooks/stop" + echo "Directory - infra/ansible/local/playbooks/destroy" echo "File - infra/ansible/local/playbooks/vars.ansible.yml" echo "Directory - infra/ansible/remote/nodes/playbooks/deploy" echo "Directory - infra/ansible/remote/nodes/playbooks/start" @@ -136,6 +137,9 @@ function update_local_ansible_files() { rm -r $ANSIBLE_DIRECTORY/playbooks/stop cp -r $INFRA_PATH/euclid-development-environment/infra/ansible/local/playbooks/stop $ANSIBLE_DIRECTORY/playbooks + rm -r $ANSIBLE_DIRECTORY/playbooks/destroy + cp -r $INFRA_PATH/euclid-development-environment/infra/ansible/local/playbooks/destroy $ANSIBLE_DIRECTORY/playbooks + else mkdir -p "$INFRA_PATH/ansible" cp -r $INFRA_PATH/euclid-development-environment/infra/ansible/local "$INFRA_PATH/ansible"