binaries: cleanup new upcomming rc-* commands that will replace paster * commands from pylons

This commit is contained in:
Marcin Kuzminski 2017-09-21 21:45:01 +02:00
parent a9fc01d079
commit e6fffe4b97
8 changed files with 79 additions and 17 deletions

View file

@ -616,8 +616,8 @@ ssh.authorized_keys_file_path = ~/.ssh/authorized_keys_rhodecode
## Command to execute the SSH wrapper. The binary is available in the
## rhodecode installation directory.
## e.g ~/.rccontrol/community-1/profile/bin/rcssh-wrapper
ssh.wrapper_cmd = ~/.rccontrol/community-1/rcssh-wrapper
## e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper
ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper
## Allow shell when executing the ssh-wrapper command
ssh.wrapper_cmd_allow_shell = false

View file

@ -585,8 +585,8 @@ ssh.authorized_keys_file_path = ~/.ssh/authorized_keys_rhodecode
## Command to execute the SSH wrapper. The binary is available in the
## rhodecode installation directory.
## e.g ~/.rccontrol/community-1/profile/bin/rcssh-wrapper
ssh.wrapper_cmd = ~/.rccontrol/community-1/rcssh-wrapper
## e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper
ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper
## Allow shell when executing the ssh-wrapper command
ssh.wrapper_cmd_allow_shell = false

View file

@ -22,7 +22,7 @@ section.
gunicorn rhodecode-extensions svn svnversion
hg rhodecode-gist svnadmin vcsserver
paster rhodecode-index svndumpfilter
rcserver rhodecode-list-instances svnlook
rc-server rhodecode-list-instances svnlook
rhodecode-api rhodecode-setup-config svnmucc
You can then use the tools as described in the :ref:`rc-tools` section using the

View file

@ -145,9 +145,9 @@ let
--repos=$PWD/repos \
enterprise.ini > /dev/null
echo "Starting rcserver"
echo "Starting rc-server"
vcsserver --config ${vcsserverCfg} >vcsserver.log 2>&1 &
rcserver enterprise.ini >rcserver.log 2>&1 &
rc-server enterprise.ini >rc-server.log 2>&1 &
while ! curl -f -s http://localhost:5000 > /dev/null
do
@ -159,7 +159,7 @@ let
echo "Starting the test run"
py.test -c example.ini -vs --maxfail=5 tests
echo "Kill rcserver"
echo "Kill rc-server"
kill %2
kill %1
'';
@ -170,13 +170,13 @@ let
mkdir -p $out
cp enterprise.ini $out
cp ${vcsserverCfg} $out/vcsserver.ini
cp rcserver.log $out
cp rc-server.log $out
cp vcsserver.log $out
mkdir -p $out/nix-support
echo "report config $out enterprise.ini" >> $out/nix-support/hydra-build-products
echo "report config $out vcsserver.ini" >> $out/nix-support/hydra-build-products
echo "report rcserver $out rcserver.log" >> $out/nix-support/hydra-build-products
echo "report rc-server $out rc-server.log" >> $out/nix-support/hydra-build-products
echo "report vcsserver $out vcsserver.log" >> $out/nix-support/hydra-build-products
'';
};

View file

@ -0,0 +1,61 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2016-2017 RhodeCode GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License, version 3
# (only), as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# This program is dual-licensed. If you wish to learn more about the
# RhodeCode Enterprise Edition, including its added features, Support services,
# and proprietary license terms, please see https://rhodecode.com/licenses/
import click
from pyramid.paster import bootstrap
from pyramid.request import Request
import pyramid.paster
# imports, used in ipython shell
import os
import sys
import time
import shutil
import datetime
from rhodecode.model.db import *
welcome_banner = """Welcome to RhodeCode iShell.
Type `exit` to exit the shell.
iShell is interactive shell to interact directly with the
internal RhodeCode APIs. You can rescue your lost password,
or reset some user/system settings.
"""
@click.command()
@click.argument('ini_path', type=click.Path(exists=True))
def main(ini_path):
pyramid.paster.setup_logging(ini_path)
request = Request.blank('/', base_url='https://rhodecode-app.com/')
with bootstrap(ini_path, request=request) as env:
try:
from IPython import embed
from traitlets.config import Config
cfg = Config()
cfg.InteractiveShellEmbed.confirm_exit = False
embed(config=cfg, banner1=welcome_banner)
except ImportError:
print('ipython installation required for ishell')
sys.exit(-1)

View file

@ -166,7 +166,7 @@ def rc_web_server(
assert_no_running_instance(host_url)
command = ['pserve', rc_web_server_config]
print('Starting rcserver: {}'.format(host_url))
print('Starting rhodecode server: {}'.format(host_url))
print('Command: {}'.format(command))
print('Logfile: {}'.format(rc_log))

View file

@ -654,8 +654,8 @@ ssh.authorized_keys_file_path = %(here)s/rc/authorized_keys_rhodecode
## Command to execute the SSH wrapper. The binary is available in the
## rhodecode installation directory.
## e.g ~/.rccontrol/community-1/profile/bin/rcssh-wrapper
ssh.wrapper_cmd = ~/.rccontrol/community-1/rcssh-wrapper
## e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper
ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper
## Allow shell when executing the ssh-wrapper command
ssh.wrapper_cmd_allow_shell = false

View file

@ -248,10 +248,11 @@ setup(
'enterprise=rhodecode.tests.plugin',
],
'console_scripts': [
'rcserver=rhodecode.rcserver:main',
'rcsetup-app=rhodecode.lib.rc_commands.setup_rc:main',
'rcupgrade-db=rhodecode.lib.rc_commands.upgrade_db:main',
'rcssh-wrapper=rhodecode.apps.ssh_support.lib.ssh_wrapper:main',
'rc-server=rhodecode.rcserver:main',
'rc-setup-app=rhodecode.lib.rc_commands.setup_rc:main',
'rc-upgrade-db=rhodecode.lib.rc_commands.upgrade_db:main',
'rc-ishell=rhodecode.lib.rc_commands.ishell:main',
'rc-ssh-wrapper=rhodecode.apps.ssh_support.lib.ssh_wrapper:main',
],
'beaker.backends': [
'memorylru_base=rhodecode.lib.memory_lru_debug:MemoryLRUNamespaceManagerBase',