##// END OF EJS Templates
binaries: cleanup new upcomming rc-* commands that will replace paster * commands from pylons
marcink -
r2119:065ff5ed default
parent child Browse files
Show More
@@ -0,0 +1,61 b''
1 # -*- coding: utf-8 -*-
2
3 # Copyright (C) 2016-2017 RhodeCode GmbH
4 #
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License, version 3
7 # (only), as published by the Free Software Foundation.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
17 # This program is dual-licensed. If you wish to learn more about the
18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
21 import click
22
23 from pyramid.paster import bootstrap
24 from pyramid.request import Request
25 import pyramid.paster
26
27 # imports, used in ipython shell
28 import os
29 import sys
30 import time
31 import shutil
32 import datetime
33 from rhodecode.model.db import *
34
35 welcome_banner = """Welcome to RhodeCode iShell.
36 Type `exit` to exit the shell.
37 iShell is interactive shell to interact directly with the
38 internal RhodeCode APIs. You can rescue your lost password,
39 or reset some user/system settings.
40 """
41
42
43 @click.command()
44 @click.argument('ini_path', type=click.Path(exists=True))
45 def main(ini_path):
46 pyramid.paster.setup_logging(ini_path)
47
48 request = Request.blank('/', base_url='https://rhodecode-app.com/')
49 with bootstrap(ini_path, request=request) as env:
50
51 try:
52 from IPython import embed
53 from traitlets.config import Config
54 cfg = Config()
55 cfg.InteractiveShellEmbed.confirm_exit = False
56 embed(config=cfg, banner1=welcome_banner)
57 except ImportError:
58 print('ipython installation required for ishell')
59 sys.exit(-1)
60
61
@@ -616,8 +616,8 b' ssh.authorized_keys_file_path = ~/.ssh/a'
616 616
617 617 ## Command to execute the SSH wrapper. The binary is available in the
618 618 ## rhodecode installation directory.
619 ## e.g ~/.rccontrol/community-1/profile/bin/rcssh-wrapper
620 ssh.wrapper_cmd = ~/.rccontrol/community-1/rcssh-wrapper
619 ## e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper
620 ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper
621 621
622 622 ## Allow shell when executing the ssh-wrapper command
623 623 ssh.wrapper_cmd_allow_shell = false
@@ -585,8 +585,8 b' ssh.authorized_keys_file_path = ~/.ssh/a'
585 585
586 586 ## Command to execute the SSH wrapper. The binary is available in the
587 587 ## rhodecode installation directory.
588 ## e.g ~/.rccontrol/community-1/profile/bin/rcssh-wrapper
589 ssh.wrapper_cmd = ~/.rccontrol/community-1/rcssh-wrapper
588 ## e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper
589 ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper
590 590
591 591 ## Allow shell when executing the ssh-wrapper command
592 592 ssh.wrapper_cmd_allow_shell = false
@@ -22,7 +22,7 b' section.'
22 22 gunicorn rhodecode-extensions svn svnversion
23 23 hg rhodecode-gist svnadmin vcsserver
24 24 paster rhodecode-index svndumpfilter
25 rcserver rhodecode-list-instances svnlook
25 rc-server rhodecode-list-instances svnlook
26 26 rhodecode-api rhodecode-setup-config svnmucc
27 27
28 28 You can then use the tools as described in the :ref:`rc-tools` section using the
@@ -145,9 +145,9 b' let'
145 145 --repos=$PWD/repos \
146 146 enterprise.ini > /dev/null
147 147
148 echo "Starting rcserver"
148 echo "Starting rc-server"
149 149 vcsserver --config ${vcsserverCfg} >vcsserver.log 2>&1 &
150 rcserver enterprise.ini >rcserver.log 2>&1 &
150 rc-server enterprise.ini >rc-server.log 2>&1 &
151 151
152 152 while ! curl -f -s http://localhost:5000 > /dev/null
153 153 do
@@ -159,7 +159,7 b' let'
159 159 echo "Starting the test run"
160 160 py.test -c example.ini -vs --maxfail=5 tests
161 161
162 echo "Kill rcserver"
162 echo "Kill rc-server"
163 163 kill %2
164 164 kill %1
165 165 '';
@@ -170,13 +170,13 b' let'
170 170 mkdir -p $out
171 171 cp enterprise.ini $out
172 172 cp ${vcsserverCfg} $out/vcsserver.ini
173 cp rcserver.log $out
173 cp rc-server.log $out
174 174 cp vcsserver.log $out
175 175
176 176 mkdir -p $out/nix-support
177 177 echo "report config $out enterprise.ini" >> $out/nix-support/hydra-build-products
178 178 echo "report config $out vcsserver.ini" >> $out/nix-support/hydra-build-products
179 echo "report rcserver $out rcserver.log" >> $out/nix-support/hydra-build-products
179 echo "report rc-server $out rc-server.log" >> $out/nix-support/hydra-build-products
180 180 echo "report vcsserver $out vcsserver.log" >> $out/nix-support/hydra-build-products
181 181 '';
182 182 };
@@ -166,7 +166,7 b' def rc_web_server('
166 166 assert_no_running_instance(host_url)
167 167 command = ['pserve', rc_web_server_config]
168 168
169 print('Starting rcserver: {}'.format(host_url))
169 print('Starting rhodecode server: {}'.format(host_url))
170 170 print('Command: {}'.format(command))
171 171 print('Logfile: {}'.format(rc_log))
172 172
@@ -654,8 +654,8 b' ssh.authorized_keys_file_path = %(here)s'
654 654
655 655 ## Command to execute the SSH wrapper. The binary is available in the
656 656 ## rhodecode installation directory.
657 ## e.g ~/.rccontrol/community-1/profile/bin/rcssh-wrapper
658 ssh.wrapper_cmd = ~/.rccontrol/community-1/rcssh-wrapper
657 ## e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper
658 ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper
659 659
660 660 ## Allow shell when executing the ssh-wrapper command
661 661 ssh.wrapper_cmd_allow_shell = false
@@ -248,10 +248,11 b' setup('
248 248 'enterprise=rhodecode.tests.plugin',
249 249 ],
250 250 'console_scripts': [
251 'rcserver=rhodecode.rcserver:main',
252 'rcsetup-app=rhodecode.lib.rc_commands.setup_rc:main',
253 'rcupgrade-db=rhodecode.lib.rc_commands.upgrade_db:main',
254 'rcssh-wrapper=rhodecode.apps.ssh_support.lib.ssh_wrapper:main',
251 'rc-server=rhodecode.rcserver:main',
252 'rc-setup-app=rhodecode.lib.rc_commands.setup_rc:main',
253 'rc-upgrade-db=rhodecode.lib.rc_commands.upgrade_db:main',
254 'rc-ishell=rhodecode.lib.rc_commands.ishell:main',
255 'rc-ssh-wrapper=rhodecode.apps.ssh_support.lib.ssh_wrapper:main',
255 256 ],
256 257 'beaker.backends': [
257 258 'memorylru_base=rhodecode.lib.memory_lru_debug:MemoryLRUNamespaceManagerBase',
General Comments 0
You need to be logged in to leave comments. Login now