-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.sh
executable file
·34 lines (27 loc) · 944 Bytes
/
test.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
#!/bin/bash
BUCKET=$(cat terraform.tfstate | jq '.outputs.bucket.value // empty' -r)
if [ -z "$BUCKET" ]
then
echo "BUCKET value is empty, unable to fetch from terraform.tfstate"
exit 1;
fi
DIR="drone_dataset_brighton_beach-master"
if [ -d "$DIR" ]
then
if [ "$(ls -A $DIR)" ]; then
echo "$DIR exists, reusing data"
else
echo "$DIR is empty, fetching example data"
curl -OL https://github.com/pierotofy/drone_dataset_brighton_beach/archive/refs/heads/master.zip
unzip master.zip
rm master.zip
fi
else
echo "Directory $DIR does not exist. Fetching."
curl -OL https://github.com/pierotofy/drone_dataset_brighton_beach/archive/refs/heads/master.zip
unzip master.zip
rm master.zip
fi
aws s3 sync $DIR/images/ "s3://$BUCKET/brighton_beach/"
aws s3 cp settings.yaml "s3://$BUCKET/brighton_beach/settings.yaml"
aws s3 cp process "s3://$BUCKET/brighton_beach/process"