~developer-ubuntu-com-dev/developer-ubuntu-com/production

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: David Callé
  • Date: 2015-12-04 11:42:16 UTC
  • Revision ID: davidc@framli.eu-20151204114216-0qv5mipose9lmq16
Revert to what we have live in prod

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
SOURCE_DIR := $(PWD)
4
4
REVNO := `bzr revno`
5
5
 
6
 
update-1470715:
7
 
        @python manage.py migrate
8
 
 
9
6
update-instance:
10
7
        @echo "Nothing to do for the app";
11
 
 
 
8
        
12
9
update-common:
13
10
        @echo "Updating database"
14
11
        if [ $(DATABASE_URL) ]; then $(MAKE) initdb; fi
17
14
 
18
15
swift-perms:
19
16
        @echo "Setting up Swift bucket permissions"
20
 
        @if [ "${SWIFT_CONTAINER_NAME}" = "" ]; then echo "Using default upload container"; http_proxy=http://"${swift_proxy}" https_proxy=https://"${swift_proxy}" swift post --read-acl '.r:*' devportal_uploaded; else http_proxy=http://"${swift_proxy}" https_proxy=https://"${swift_proxy}" swift post --read-acl '.r:*' $(SWIFT_CONTAINER_NAME); fi
21
 
        @if [ "${SWIFT_STATICCONTAINER_NAME}" = "" ]; then echo "Using default static container"; http_proxy=http://"${swift_proxy}" https_proxy=https://"${swift_proxy}" swift post --read-acl '.r:*' devportal_static; else http_proxy=http://"${swift_proxy}" https_proxy=https://"${swift_proxy}" swift post --read-acl '.r:*' $(SWIFT_STATICCONTAINER_NAME); fi
 
17
        @if [ "${SWIFT_CONTAINER_NAME}" = "" ]; then echo "Using default upload container"; http_proxy="${swift_proxy}" https_proxy="${swift_proxy}" swift post --read-acl '.r:*' devportal_uploaded; else http_proxy="${swift_proxy}" https_proxy="${swift_proxy}" swift post --read-acl '.r:*' $(SWIFT_CONTAINER_NAME); fi
 
18
        @if [ "${SWIFT_STATICCONTAINER_NAME}" = "" ]; then echo "Using default static container"; http_proxy="${swift_proxy}" https_proxy="${swift_proxy}" swift post --read-acl '.r:*' devportal_static; else http_proxy="${swift_proxy}" https_proxy="${swift_proxy}" swift post --read-acl '.r:*' $(SWIFT_STATICCONTAINER_NAME); fi
22
19
 
23
20
update-apidocs:
24
21
        if [ $(DATABASE_URL) ]; then DJANGO_SETTINGS_MODULE=charm_settings ./update_apidocs.sh > ${PWD}/../../logs/update_apidocs.log 2>${PWD}/../../logs/update_apidocs_errors.log; fi
48
45
        @python manage.py init_apidocs --settings charm_settings
49
46
 
50
47
syncdb:
51
 
        @echo "Syncing/migrating database"
52
 
        @python manage.py migrate --noinput --settings charm_settings
 
48
        @echo "Syncing database"
 
49
        @python manage.py syncdb --noinput --migrate --settings charm_settings
53
50
 
54
51
collectstatic: collectstatic.done
55
52
collectstatic.done:
56
53
        @echo "Collecting static files"
57
 
        @http_proxy=http://"${swift_proxy}" https_proxy=https://"${swift_proxy}" python manage.py collectstatic -v 0 --noinput --settings charm_settings 2>/dev/null
 
54
        @http_proxy="${swift_proxy}" https_proxy="${swift_proxy}" python manage.py collectstatic -v 0 --noinput --settings charm_settings 2>/dev/null
58
55
        @touch collectstatic.done
59
56
 
60
57
collectstatic.debug:
61
58
        @echo "Debugging output from collectstatic"
62
 
        @http_proxy=http://"${swift_proxy}" https_proxy=https://"${swift_proxy}" python manage.py collectstatic -v 1 --noinput --settings charm_settings
 
59
        @http_proxy="${swift_proxy}" https_proxy="${swift_proxy}" python manage.py collectstatic -v 1 --noinput --settings charm_settings
63
60
 
64
61
update-pip-cache:
65
62
        @echo "Updating pip-cache"
66
63
        rm -rf pip-cache
67
64
        bzr branch lp:~developer-ubuntu-com-dev/developer-ubuntu-com/dependencies pip-cache
68
65
        pip install --exists-action=w --download pip-cache/ -r requirements.txt
69
 
        bzr add pip-cache/*
 
66
        bzr add pip-cache/* 
70
67
        bzr commit pip-cache/ -m 'automatically updated devportal requirements'
71
68
        bzr push --directory pip-cache lp:~developer-ubuntu-com-dev/developer-ubuntu-com/dependencies
72
69
        bzr revno pip-cache > pip-cache-revno.txt
85
82
 
86
83
db.sqlite3: env
87
84
        @echo "Initializing database"
88
 
        @./env/bin/python manage.py migrate --noinput
 
85
        @./env/bin/python manage.py syncdb --noinput --migrate
89
86
        @./env/bin/python manage.py initdb
90
87
        @./env/bin/python manage.py init_apidocs
91
88
 
114
111
        @rm ../developer_portal.tar.gz
115
112
        @$(MAKE) tarball;
116
113
        @echo build_label=`bzr revno`
 
114