Skip to content

Commit c30b4b5

Browse files
committed
1.0.2: Added code to detect if vagrant shares were not correctly set before continuing
1 parent 2ad64b5 commit c30b4b5

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

example.config.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ vagrant_synced_folders:
1717
type:
1818
create: true
1919

20-
- local_path: ~/Sites/mysql_data
21-
destination: /srv/mysql_data
20+
- local_path: ~/Sites/mysql
21+
destination: /srv/mysql
2222
type:
2323
create: true
2424
owner: 500 # mysql user not created yet, but will have this id when the box is provisioned
2525
group: 500 # mysql group not created yet, but will have this id when the box is provisioned
2626

27-
- local_path: ~/Sites/mysql_backups
28-
destination: /srv/mysql_backups
27+
- local_path: ~/Sites/backup
28+
destination: /srv/backup
2929
type:
3030
create: true
3131

scripts/000-setup_environment.sh

+17-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,25 @@ echo "******************************"
33
echo "* 000-setup_environment.sh *"
44
echo "******************************"
55

6+
if [ ! -d /srv/backup ] || [ ! -d /srv/mysql ] || [ ! -d /srv/www ]; then
7+
echo -e "\033[1;31mError:\033[0;31m Your config.yml file must include shared mounted folders mapping to /srv/backup, /srv/mysql and /srv/www\033[0m"
8+
echo -e "\033[0;31mPlease see example.config.yml for how to do set this up.\033[0m"
9+
echo -e "\033[0;31mThe current operation has been aborted.\033[0m"
10+
exit 1
11+
fi
12+
613
# Enable trace printing and exit on the first error
714
set -ex
815

16+
# Create backup folders for mysql and web config
17+
mkdir -p /srv/backup/mysql
18+
mkdir -p /srv/backup/webconfig
19+
20+
# Create folder for mysql data
21+
mkdir -p /srv/mysql/data
22+
23+
24+
925
apt-get update
1026

1127
# Install git
@@ -41,7 +57,7 @@ mkdir -p /srv/backup/mysql
4157
mkdir -p /srv/backup/webconfig
4258

4359
# Create folder for mysql data
44-
mkdir -p /erv/mysql/data
60+
mkdir -p /srv/mysql/data
4561

4662
# Copy bash aliases and welcome message for all users
4763
cp /vagrant/files/00-aliases.sh /etc/profile.d/

0 commit comments

Comments
 (0)