Changeset - 2642f128ad46
[Not reviewed]
default
10 8 2
Marcin Kuzminski - 15 years ago 2010-10-06 15:37:23
marcin@python-works.com
removed egg info, update files for distutils build
updated READMES some config files
18 files changed with 116 insertions and 117 deletions:
0 comments (0 inline, 0 general)
MANIFEST.in
Show inline comments
 
include MANIFEST.in
 
include COPYING
 
include README.rst
 
include development.ini
 
include production.ini
 

	
 
include rhodecode/config/deployment.ini_tmpl
 

	
 
include rhodecode_daemon
 
include rhodecode_daemon2
 
#init.d scripts
 
include init.d/rhodecode-daemon
 
include init.d/rhodecode-daemon2
 

	
 
#celery config
 
include celeryconfig.py
 

	
 
#images
 
recursive-include rhodecode/public/css *
 
recursive-include rhodecode/public/images *
 

	
 
#js
 
include rhodecode/public/js/yui2.js
 
include rhodecode/public/js/excanvas.min.js
 
include rhodecode/public/js/yui.flot.js
 

	
 
recursive-include rhodecode/templates *
 
\ No newline at end of file
 
#templates
 
recursive-include rhodecode/templates *
README.rst
Show inline comments
 
@@ -46,22 +46,34 @@ Fully customizable, with authentication,
 
Installation
 
-------------
 

	
 
quick setup
 
 
 
- pip install -E rhodecode-venv http://bitbucket.org/marcinkuzminski/rhodecode/get/tip.zip
 
- activate virtualenv
 
- run `paster make-config RhodeCode production.ini`
 
- run `paster setup-app production.ini`
 
- run `paster runserver production.ini`
 

	
 
You're ready to go.
 

	
 

	
 
MORE DETAILED INSTRUCTIONS
 

	
 
- I highly recommend to install new virtualenv for rhodecode see 
 
  http://pypi.python.org/pypi/virtualenv
 
  http://pypi.python.org/pypi/virtualenv for more details.
 
- Create new virtualenv using `virtualenv --no-site-packages /var/www/rhodecode-venv`
 
  this will install new virtual env into /var/www/rhodecode-venv. 
 
  Activate the virtualenv by running 
 
  `source activate /var/www/rhodecode-venv/bin/activate`   
 
- Make a folder for rhodecode somewhere on the filesystem for example /var/www/rhodecode  
 
- Download and extract http://bitbucket.org/marcinkuzminski/rhodecode/get/tip.zip
 
  into created directory.
 
- Run `python setup.py install` in order to install the application and all
 
  needed dependencies. Make sure that You're using activated virutalenv  
 
- Run easy_install http://bitbucket.org/marcinkuzminski/rhodecode/get/tip.zip.
 
- Run `paster make-config RhodeCode production.inii` in order to install 
 
  the application config. You can play with the app settings later 
 
- Run `paster setup-app production.ini` it should create all needed tables 
 
  and an admin account make sure You specify correct path to repositories. 
 
- Remember that the given path for mercurial repositories must be write 
 
  accessible for the application
 
- Run paster serve development.ini - or you can use sample init.d scripts.
 
- Run paster serve production.ini - or you can use sample init.d scripts.
 
  the app should be available at the 127.0.0.1:5000
 
- Use admin account you created to login.
 
- Default permissions on each repository is read, and owner is admin. So remember
init.d/rhodecode-daemon
Show inline comments
 
file renamed from init.d/rhodecode_daemon to init.d/rhodecode-daemon
init.d/rhodecode-daemon2
Show inline comments
 
file renamed from init.d/rhodecode_daemon2 to init.d/rhodecode-daemon2
rhodecode.egg-info/PKG-INFO
Show inline comments
 
deleted file
rhodecode.egg-info/SOURCES.txt
Show inline comments
 
deleted file
rhodecode.egg-info/dependency_links.txt
Show inline comments
 
deleted file
rhodecode.egg-info/entry_points.txt
Show inline comments
 
deleted file
rhodecode.egg-info/not-zip-safe
Show inline comments
 
deleted file
rhodecode.egg-info/paster_plugins.txt
Show inline comments
 
deleted file
rhodecode.egg-info/requires.txt
Show inline comments
 
deleted file
rhodecode.egg-info/top_level.txt
Show inline comments
 
deleted file
rhodecode/config/deployment.ini_tmpl
Show inline comments
 
################################################################################
 
################################################################################
 
# rhodecode - Pylons environment configuration                                    #
 
# rhodecode - Pylons environment configuration                                 #
 
#                                                                              # 
 
# The %(here)s variable will be replaced with the parent directory of this file#
 
################################################################################
 
@@ -9,8 +9,8 @@
 
debug = true
 
################################################################################
 
## Uncomment and replace with the address which should receive                ## 
 
## any error reports after application crash								  ##
 
## Additionally those settings will be used by rhodecode mailing system          ##
 
## any error reports after application crash                                  ##
 
## Additionally those settings will be used by rhodecode mailing system       ##
 
################################################################################
 
#email_to = admin@localhost
 
#error_email_from = paste_error@localhost
 
@@ -35,12 +35,12 @@ use_threadpool = true
 

	
 
use = egg:Paste#http
 
host = 127.0.0.1
 
port = 8001
 
port = 5000
 

	
 
[app:main]
 
use = egg:rhodecode
 
full_stack = true
 
static_files = false
 
static_files = true
 
lang=en
 
cache_dir = %(here)s/data
 
app_instance_uuid = ${app_instance_uuid}
rhodecode/lib/db_manage.py
Show inline comments
 
@@ -28,8 +28,6 @@ from os.path import dirname as dn, join 
 
import os
 
import sys
 
import uuid
 
ROOT = dn(dn(dn(os.path.realpath(__file__))))
 
sys.path.append(ROOT)
 

	
 
from rhodecode.lib.auth import get_crypt_password
 
from rhodecode.lib.utils import ask_ok
 
@@ -43,20 +41,22 @@ import logging
 
log = logging.getLogger(__name__)
 

	
 
class DbManage(object):
 
    def __init__(self, log_sql, dbname, tests=False):
 
    def __init__(self, log_sql, dbname, root, tests=False):
 
        self.dbname = dbname
 
        self.tests = tests
 
        dburi = 'sqlite:////%s' % jn(ROOT, self.dbname)
 
        self.root = root
 
        dburi = 'sqlite:////%s' % jn(self.root, self.dbname)
 
        engine = create_engine(dburi, echo=log_sql) 
 
        init_model(engine)
 
        self.sa = meta.Session
 
        self.db_exists = False
 
    
 
    def check_for_db(self, override):
 
        log.info('checking for exisiting db')
 
        if os.path.isfile(jn(ROOT, self.dbname)):
 
        db_path = jn(self.root, self.dbname)
 
        log.info('checking for existing db in %s', db_path)
 
        if os.path.isfile(db_path):
 
            self.db_exists = True
 
            log.info('database exisist')
 
            log.info('database exist')
 
            if not override:
 
                raise Exception('database already exists')
 

	
 
@@ -66,7 +66,7 @@ class DbManage(object):
 
        """
 
        self.check_for_db(override)
 
        if override:
 
            log.info("database exisist and it's going to be destroyed")
 
            log.info("database exist and it's going to be destroyed")
 
            if self.tests:
 
                destroy = True
 
            else:
 
@@ -74,7 +74,7 @@ class DbManage(object):
 
            if not destroy:
 
                sys.exit()
 
            if self.db_exists and destroy:
 
                os.remove(jn(ROOT, self.dbname))
 
                os.remove(jn(self.root, self.dbname))
 
        checkfirst = not override
 
        meta.Base.metadata.create_all(checkfirst=checkfirst)
 
        log.info('Created tables for %s', self.dbname)
 
@@ -84,6 +84,10 @@ class DbManage(object):
 
            import getpass
 
            username = raw_input('Specify admin username:')
 
            password = getpass.getpass('Specify admin password:')
 
            confirm = getpass.getpass('Confirm password:')
 
            if password != confirm:
 
                log.error('passwords mismatch')
 
                sys.exit()
 
            email = raw_input('Specify admin email:')
 
            self.create_user(username, password, email, True)
 
        else:
rhodecode/lib/utils.py
Show inline comments
 
@@ -467,9 +467,11 @@ def create_test_env(repos_test_path, con
 
    log.addHandler(ch)
 
    
 
    #PART ONE create db
 
    log.debug('making test db')
 
    log.debug('making test db in %s', repos_test_path)
 
    dbname = config['sqlalchemy.db1.url'].split('/')[-1]
 
    dbmanage = DbManage(log_sql=True, dbname=dbname, tests=True)
 
    
 
    dbmanage = DbManage(log_sql=True, dbname=dbname, root=config['here'],
 
                        tests=True)
 
    dbmanage.create_tables(override=True)
 
    dbmanage.config_prompt(repos_test_path)
 
    dbmanage.create_default_user()
rhodecode/websetup.py
Show inline comments
 
"""Setup the rhodecode application"""
 

	
 
from os.path import dirname as dn
 
from os.path import dirname as dn, join as jn
 
from rhodecode.config.environment import load_environment
 
from rhodecode.lib.db_manage import DbManage
 
import logging
 
import os
 
import sys
 
import shutil
 

	
 
log = logging.getLogger(__name__)
 

	
 
ROOT = dn(dn(os.path.realpath(__file__)))
 
sys.path.append(ROOT)
 

	
 
ROOT = dn(os.path.realpath(__file__))
 

	
 
def setup_app(command, conf, vars):
 
    """Place any commands to setup rhodecode here"""
 
    log_sql = True
 
    tests = False
 
    REPO_TEST_PATH = None
 
    
 
    print dn(os.path.realpath(__file__))
 
    print(ROOT)
 
    dbname = os.path.split(conf['sqlalchemy.db1.url'])[-1] 
 
    
 
    dbmanage = DbManage(log_sql, dbname, tests)
 
    dbmanage = DbManage(log_sql=True, dbname=dbname, root=conf['here'],
 
                         tests=False)
 
    dbmanage.create_tables(override=True)
 
    dbmanage.config_prompt(REPO_TEST_PATH)
 
    dbmanage.config_prompt(None)
 
    dbmanage.create_default_user()
 
    dbmanage.admin_prompt()
 
    dbmanage.create_permissions()
 
    dbmanage.populate_default_permissions()
 
    load_environment(conf.global_conf, conf.local_conf, initial=True)
 
    
 
    celeryconfig_file = 'celeryconfig.py'
 
    
 
    celeryconfig_path = jn(ROOT, celeryconfig_file)
 
    
 
        
 
    if not os.path.isfile(jn(conf['here'], celeryconfig_file)):
 
        try:
 
            shutil.copy(celeryconfig_path, conf['here'])
 
        except IOError:
 
            log.error('failed to copy celeryconfig.py from source %s ' 
 
                      ' to this directory please copy it manually ',
 
                      celeryconfig_path)
 
        else:       
 
            load_environment(conf.global_conf, conf.local_conf, initial=True)
 

	
 

	
 

	
 

	
 

	
setup.py
Show inline comments
 
from rhodecode import get_version
 

	
 

	
 
requirements = [
 
        "Pylons>=1.0.0",
 
        "SQLAlchemy>=0.6",
 
        "babel",
 
        "Mako>=0.3.2",
 
        "vcs>=0.1.7",
 
        "pygments>=1.3.0",
 
        "mercurial>=1.6",
 
        "pysqlite",
 
        "whoosh==1.0.0",
 
        "py-bcrypt",
 
        "celery",
 
    ]
 

	
 
#additional files for project
 
data_files = [
 
              ('init.d', ['init.d/rhodecode-daemon',
 
                          'init.d/rhodecode-daemon2',
 
                          'init.d/celeryd']),
 
              ('', ['celeryconfig.py', 'production.ini', 'development.ini']),
 
              ]
 

	
 

	
 
long_description = '\n' + open('README.rst').read()
 

	
 
try:
 
    from setuptools import setup, find_packages
 
except ImportError:
 
@@ -7,28 +34,18 @@ except ImportError:
 
    from setuptools import setup, find_packages
 

	
 
setup(
 
    name='RhodeCode-%s' % get_version(),
 
    name='RhodeCode',
 
    version=get_version(),
 
    description='Mercurial repository serving and browsing app',
 
    long_description=long_description,
 
    keywords='mercurial web hgwebdir replacement serving hgweb rhodecode',
 
    license='BSD',
 
    author='marcin kuzminski',
 
    author='Marcin Kuzminski',
 
    author_email='marcin@python-works.com',
 
    url='http://hg.python-works.com',
 
    install_requires=[
 
        "Pylons>=1.0.0",
 
        "SQLAlchemy>=0.6",
 
        "babel",
 
        "Mako>=0.3.2",
 
        "vcs>=0.1.7",
 
        "pygments>=1.3.0",
 
        "mercurial>=1.6",
 
        "pysqlite",
 
        "whoosh==1.0.0b20",
 
        "py-bcrypt",
 
        "celery",
 
    ],
 
    install_requires=requirements,
 
    setup_requires=["PasteScript>=1.6.3"],
 
    data_files=data_files,
 
    packages=find_packages(exclude=['ez_setup']),
 
    include_package_data=True,
 
    test_suite='nose.collector',
test.ini
Show inline comments
 
################################################################################
 
################################################################################
 
# rhodecode - Pylons environment configuration                                    #
 
# rhodecode - Pylons environment configuration                                 #
 
#                                                                              # 
 
# The %(here)s variable will be replaced with the parent directory of this file#
 
################################################################################
 
@@ -9,8 +9,8 @@
 
debug = true
 
################################################################################
 
## Uncomment and replace with the address which should receive                ## 
 
## any error reports after application crash								  ##
 
## Additionally those settings will be used by rhodecode mailing system          ##
 
## any error reports after application crash                                  ##
 
## Additionally those settings will be used by rhodecode mailing system       ##
 
################################################################################
 
#email_to = admin@localhost
 
#error_email_from = paste_error@localhost
0 comments (0 inline, 0 general)