-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcv-deploy.sh
More file actions
23 lines (18 loc) · 738 Bytes
/
cv-deploy.sh
File metadata and controls
23 lines (18 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
package_name=$1
temp_directory=tmp_webbwebbwebb_deployment
target_directory=webbwebbwebb.co.uk
backup_directory=backup-webbwebbwebb-$(date +%Y-%m-%d-%H-%M-%S)
echo Cleaning temp directory
rm -rf $temp_directory
mkdir $temp_directory
echo Extracting "$package_name" to "$temp_directory"
tar -C "$temp_directory" -xvf "$package_name"
echo Copying "$target_directory" to "$backup_directory"
rm -rf "$backup_directory"
mkdir "$backup_directory"
cp -pr "$target_directory"/** "$backup_directory"/
echo Cleaning "$target_directory"
find "$target_directory" -maxdepth 1 ! -name .htaccess -type f -delete -print
echo Updating "$target_directory" with contents of "$temp_directory"
cp -r "$temp_directory"/** "$target_directory"/