annotate rhodecode/websetup.py @ 834:8924ed0e4f36 beta

added current db version into rhodecode, added auto versioning of newly created databases
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 11 Dec 2010 02:15:29 +0100
parents 7ae66bddf48d
children 78b3d2d730f2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
547
1e757ac98988 renamed project to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents: 491
diff changeset
1 """Setup the rhodecode application"""
1e757ac98988 renamed project to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents: 491
diff changeset
2 from rhodecode.config.environment import load_environment
1e757ac98988 renamed project to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents: 491
diff changeset
3 from rhodecode.lib.db_manage import DbManage
0
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
4 import logging
327
0e87466a117e updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents: 0
diff changeset
5 import os
469
e94f4e54dc03 tests fix, put vcs testing tarball
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
6
0
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
7 log = logging.getLogger(__name__)
473
6b934c9607e7 Improved testing scenarios. Made test env creator
Marcin Kuzminski <marcin@python-works.com>
parents: 469
diff changeset
8
0
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
9 def setup_app(command, conf, vars):
547
1e757ac98988 renamed project to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents: 491
diff changeset
10 """Place any commands to setup rhodecode here"""
781
7ae66bddf48d fixed db manage, to work on other databases than sqlite
Marcin Kuzminski <marcin@python-works.com>
parents: 555
diff changeset
11 dbconf = conf['sqlalchemy.db1.url']
7ae66bddf48d fixed db manage, to work on other databases than sqlite
Marcin Kuzminski <marcin@python-works.com>
parents: 555
diff changeset
12 dbmanage = DbManage(log_sql=True, dbconf=dbconf, root=conf['here'], tests=False)
327
0e87466a117e updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents: 0
diff changeset
13 dbmanage.create_tables(override=True)
834
8924ed0e4f36 added current db version into rhodecode,
Marcin Kuzminski <marcin@python-works.com>
parents: 781
diff changeset
14 dbmanage.set_db_version()
552
2642f128ad46 removed egg info, update files for distutils build
Marcin Kuzminski <marcin@python-works.com>
parents: 547
diff changeset
15 dbmanage.config_prompt(None)
459
7c978511c951 implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents: 417
diff changeset
16 dbmanage.create_default_user()
327
0e87466a117e updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents: 0
diff changeset
17 dbmanage.admin_prompt()
0e87466a117e updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents: 0
diff changeset
18 dbmanage.create_permissions()
417
3ed2d46a2ca7 permission refactoring,
Marcin Kuzminski <marcin@python-works.com>
parents: 365
diff changeset
19 dbmanage.populate_default_permissions()
781
7ae66bddf48d fixed db manage, to work on other databases than sqlite
Marcin Kuzminski <marcin@python-works.com>
parents: 555
diff changeset
20
555
03676d39dd0a added fault tolerant case when celeryconfig is not present in the directory.
Marcin Kuzminski <marcin@python-works.com>
parents: 552
diff changeset
21 load_environment(conf.global_conf, conf.local_conf, initial=True)
327
0e87466a117e updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents: 0
diff changeset
22
552
2642f128ad46 removed egg info, update files for distutils build
Marcin Kuzminski <marcin@python-works.com>
parents: 547
diff changeset
23
2642f128ad46 removed egg info, update files for distutils build
Marcin Kuzminski <marcin@python-works.com>
parents: 547
diff changeset
24
2642f128ad46 removed egg info, update files for distutils build
Marcin Kuzminski <marcin@python-works.com>
parents: 547
diff changeset
25
2642f128ad46 removed egg info, update files for distutils build
Marcin Kuzminski <marcin@python-works.com>
parents: 547
diff changeset
26