File tree 3 files changed +9
-7
lines changed
3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 4
4
# up again. This script gets executed directly, so it could be python, php,
5
5
# ruby, etc.
6
6
7
- source $OPENSHIFT_GEAR_DIR /virtenv/bin/activate
7
+ cartridge_type=" python-2.6"
8
+ source $OPENSHIFT_HOMEDIR /$cartridge_type /virtenv/bin/activate
8
9
9
10
if [ ! -f $OPENSHIFT_DATA_DIR /sqlite3.db ]
10
11
then
Original file line number Diff line number Diff line change @@ -21,17 +21,18 @@ OpenShift provides several environment variables to reference for ease
21
21
of use. The following list are some common variables but far from exhaustive:
22
22
23
23
os.environ['OPENSHIFT_APP_NAME'] - Application name
24
- os.environ['OPENSHIFT_GEAR_DIR'] - Application dir
25
24
os.environ['OPENSHIFT_DATA_DIR'] - For persistent storage (between pushes)
26
25
os.environ['OPENSHIFT_TMP_DIR'] - Temp storage (unmodified files deleted after 10 days)
27
26
28
27
When embedding a database using 'rhc app cartridge add', you can reference environment
29
28
variables for username, host and password:
30
29
31
- os.environ['OPENSHIFT_DB_HOST'] - DB host
32
- os.environ['OPENSHIFT_DB_PORT'] - DB Port
33
- os.environ['OPENSHIFT_DB_USERNAME'] - DB Username
34
- os.environ['OPENSHIFT_DB_PASSWORD'] - DB Password
30
+ If you embed MySQL, then:
31
+
32
+ os.environ['OPENSHIFT_MYSQL_DB_HOST'] - DB host
33
+ os.environ['OPENSHIFT_MYSQL_DB_PORT'] - DB Port
34
+ os.environ['OPENSHIFT_MYSQL_DB_USERNAME'] - DB Username
35
+ os.environ['OPENSHIFT_MYSQL_DB_PASSWORD'] - DB Password
35
36
36
37
To get a full list of environment variables, simply add a line in your
37
38
.openshift/action_hooks/build script that says "export" and push.
Original file line number Diff line number Diff line change 18
18
MANAGERS = ADMINS
19
19
20
20
if ON_OPENSHIFT :
21
- # os.environ['OPENSHIFT_DB_ *'] variables can be used with databases created
21
+ # os.environ['OPENSHIFT_MYSQL_DB_ *'] variables can be used with databases created
22
22
# with rhc app cartridge add (see /README in this git repo)
23
23
DATABASES = {
24
24
'default' : {
You can’t perform that action at this time.
0 commit comments