-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremote-post-transfer.bash
More file actions
38 lines (30 loc) · 856 Bytes
/
remote-post-transfer.bash
File metadata and controls
38 lines (30 loc) · 856 Bytes
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
full_transfer_path=${full_transfer_path:-"/dev/null"}
source_dir="$full_transfer_path"
destination_dir="$ACTION_PATH/$GITHUB_REF_NAME"
destination_dir_prev="$destination_dir.previous"
if [ "$1" == "CHOWN" ]
then
echo "Changing owner to $ACTION_PATH_OWNER"
chown -R "$ACTION_PATH_OWNER" "$destination_dir"
echo "Done"
exit
fi
echo "Started post-transfer script with source ($source_dir) destination ($destination_dir)"
if [[ ! -d "$ACTION_PATH" ]]
then
mkdir -p "$ACTION_PATH"
fi
if [[ -d "$destination_dir" ]]
then
if [[ -d "$destination_dir_prev" ]]
then
rm -rf "$destination_dir_prev"
fi
mv "$destination_dir" "$destination_dir_prev"
fi
mv "$source_dir" "$destination_dir"
echo "Completed post-transfer script"
# TODO:
# Receive the following:
# Add symlinks from a definition list somewhere
# Set a special deployment config variable