To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / deploy / provision.d / 030-webapp-dir.sh @ 1595:98384d0defa0

History | View | Annotate | Download (996 Bytes)

1
#!/bin/bash
2

    
3
set -e
4

    
5
# We might be running in one of two ways:
6
#
7
# 1. The code directory is already at /var/www/code, either because a
8
# previous provisioning step has imported it there or because this
9
# script has been run before -- in this situation all we do is
10
# re-check the ownership and permissions. OR
11
#
12
# 2. The code directory has not yet been copied to /var/www/code, in
13
# which case we expect to find it at /code-to-deploy, e.g. as a
14
# Vagrant shared folder, and we copy it over from there. (We don't
15
# deploy directly from shared folders as we might not be able to
16
# manipulate ownership and permissions properly there.)
17

    
18
if [ ! -d /var/www/code ]; then
19
    if [ ! -d /code-to-deploy ]; then
20
        echo "ERROR: Expected to find code tree at /var/www/code or /code-to-deploy: is the deployment script being invoked correctly?"
21
        exit 2
22
    fi
23
    cp -a /code-to-deploy /var/www/code
24
fi
25

    
26
chown -R code.www-data /var/www/code
27
find /var/www/code -type d -exec chmod g+s \{\} \;
28

    
29