-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathsetup.sh
68 lines (48 loc) · 1.8 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
# setup a devU install using the prebuilt images
# also sets up the required tango config
owner="$1"
branch="$2"
if [ -z "$owner" ] || [ -z "$branch" ]; then
echo "Usage: $0 <owner> <branch>"
echo "Example: $0 makeopensource develop"
exit 1
fi
repo="devU"
compose_file_path="example-docker-compose.yml"
compose_local_filename="docker-compose.yml"
raw_url="https://raw.githubusercontent.com/$owner/$repo/$branch/$compose_file_path"
echo "Downloading $compose_file_path from $owner/$repo (branch: $branch) to $compose_local_filename"
if curl -sSL "$raw_url" -o "$compose_local_filename"; then
echo "Download successful!"
else
echo "Download failed. Check the repository, branch, and file path."
exit 1
fi
tango_conf_filename="tango.config.py"
raw_url="https://raw.githubusercontent.com/$owner/$repo/$branch/$tango_conf_filename"
echo "Downloading $tango_conf_filename from $owner/$repo (branch: $branch) to $tango_conf_filename"
if curl -sSL "$raw_url" -o "$tango_conf_filename"; then
echo "Download successful!"
else
echo "Download failed. Check the repository, branch, and file path."
exit 1
fi
# Create the 'tango_files' directory if it doesn't exist
mkdir -p tango_files
# Get the absolute path of the 'tango_files' directory
absolute_path=$(realpath tango_files)
docker_compose_file="docker-compose.yml"
if [ ! -f "$docker_compose_file" ]; then
echo "Error: Docker Compose file '$docker_compose_file' not found."
exit 1
fi
# 5. Use sed to replace the placeholder with the absolute path
if sed -i "s|DOCKER_TANGO_HOST_VOLUME_PATH=.*|DOCKER_TANGO_HOST_VOLUME_PATH=$absolute_path|" "$docker_compose_file"; then
echo "Successfully updated $docker_compose_file with path: $absolute_path"
else
echo "Error: Failed to update $docker_compose_file."
exit 1
fi
docker compose up
exit 0