Skip to content
Snippets Groups Projects
Commit 27d3ecd5 authored by Marc-Olivier Andrez's avatar Marc-Olivier Andrez
Browse files

build: enable running deploy script from other directories than the root directory

This commit modifies the script `deploy/build_env/services-linux/run_asapo.sh`
so that we can call it from directories other than the project root directory.
When developing on a local machine, this is very convenient because we
can build changes from a build directory and then directly run the
deploy script from this build directory.
parent 09c2244d
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# The value of `source_build_dir` is either "$1" or "build" if no argument is provided
# to the script.
source_build_dir="${1:-build}"
# Usage:
# bash run_asapo.sh [source_build_dir]
#
# Arguments:
# source_build_dir directory that contains the binaries to deploy.
# The default value is $project_project_root_dir/build where
# $project_project_root_dir is the root directory of the ASAPO project.
# Calculate the path of `project_root_dir` from the current script directory.
project_root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && git rev-parse --show-toplevel)"
# The value of `source_build_dir` is either "$1" or "$project_root_dir/build"
# if no argument is provided to the script.
source_build_dir="${1:-$project_root_dir/build}"
cp "$source_build_dir"/authorizer/asapo-authorizer /asapo-authorizer
cp "$source_build_dir"/discovery/asapo-discovery /asapo-discovery
......@@ -11,17 +21,17 @@ cp "$source_build_dir"/file_transfer/asapo-file-transfer /asapo-file-transfer
cp "$source_build_dir"/receiver/receiver /receiver
cp "$source_build_dir"/monitoring/monitoring_server/asapo-monitoring-server /asapo-monitoring-server
cp deploy/asapo_services_light/*json /
cp deploy/asapo_services_light/envoy.yaml /
cp "$project_root_dir"/deploy/asapo_services_light/*json /
cp "$project_root_dir"/deploy/asapo_services_light/envoy.yaml /
# Several receiver configs (tcp and fabric) are required for tests
cp deploy/asapo_services_light/receiver.json /receiver_tcp.json
cp deploy/build_env/services-linux/receiver_fabric.json /
cp deploy/build_env/services-linux/receiver_kafka.json /
cp "$project_root_dir"/deploy/asapo_services_light/receiver.json /receiver_tcp.json
cp "$project_root_dir"/deploy/build_env/services-linux/receiver_fabric.json /
cp "$project_root_dir"/deploy/build_env/services-linux/receiver_kafka.json /
cp deploy/build_env/services-linux/discovery.json /
cp deploy/build_env/services-linux/*key /
cp deploy/build_env/services-linux/supervisord.conf /etc/
cp "$project_root_dir"/deploy/build_env/services-linux/discovery.json /
cp "$project_root_dir"/deploy/build_env/services-linux/*key /
cp "$project_root_dir"/deploy/build_env/services-linux/supervisord.conf /etc/
cp "$source_build_dir"/deploy/asapo_services_light/nginx.conf /etc/nginx/nginx.conf
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment