Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
Managetests
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gruppo Web
Managetests
Commits
cc1d564f
Commit
cc1d564f
authored
Dec 20, 2015
by
Pietro Albini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to change the port for the frontend server
parent
60674b98
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
7 deletions
+11
-7
managetests/__main__.py
managetests/__main__.py
+4
-2
managetests/app.py
managetests/app.py
+2
-2
managetests/instances.py
managetests/instances.py
+3
-2
nginx.conf
nginx.conf
+2
-1
No files found.
managetests/__main__.py
View file @
cc1d564f
...
...
@@ -98,13 +98,15 @@ def init_command(ctx, git_url):
@
cli
.
command
(
"run"
)
@
click
.
option
(
"-p"
,
"--port"
,
help
=
"The port for the frontend application"
,
default
=
8080
)
@
click
.
pass_obj
def
run_command
(
obj
):
def
run_command
(
obj
,
port
):
"""Run managetests"""
root
=
obj
[
"root"
]
with
open
(
os
.
path
.
join
(
root
,
"config.json"
))
as
f
:
config
=
json
.
load
(
f
)
inst
=
app
.
TestsManager
(
root
,
config
)
inst
=
app
.
TestsManager
(
root
,
config
,
port
)
inst
.
run
()
managetests/app.py
View file @
cc1d564f
...
...
@@ -29,7 +29,7 @@ from . import gitlab
class
TestsManager
:
"""Main instance of the application"""
def
__init__
(
self
,
root
,
config
):
def
__init__
(
self
,
root
,
config
,
port
):
self
.
config
=
config
self
.
root
=
os
.
path
.
abspath
(
root
)
...
...
@@ -37,7 +37,7 @@ class TestsManager:
hooks_processor
=
frontend
.
HooksProcessor
(
self
)
self
.
frontend
=
frontend
.
create_app
(
self
,
hooks_processor
)
self
.
instances
=
instances
.
InstancesManager
(
self
,
self
.
frontend
,
self
.
instances
=
instances
.
InstancesManager
(
self
,
self
.
frontend
,
port
,
hooks_processor
)
if
not
utils
.
is_root_valid
(
root
):
...
...
managetests/instances.py
View file @
cc1d564f
...
...
@@ -24,7 +24,7 @@ from werkzeug import serving
class
InstancesManager
:
"""This class will manage all the running branches"""
def
__init__
(
self
,
manager
,
main
,
processor
):
def
__init__
(
self
,
manager
,
main
,
main_port
,
processor
):
self
.
manager
=
manager
self
.
running
=
False
...
...
@@ -33,6 +33,7 @@ class InstancesManager:
self
.
_branches
=
{}
self
.
_main_app
=
main
self
.
_main_port
=
main_port
self
.
_hooks_processor
=
processor
atexit
.
register
(
_stop
(
self
))
...
...
@@ -66,7 +67,7 @@ class InstancesManager:
# Starts also the receiver part
self
.
_hooks_processor
.
start
()
serving
.
run_simple
(
"127.0.0.1"
,
8080
,
self
.
_main_app
)
serving
.
run_simple
(
"127.0.0.1"
,
self
.
_main_port
,
self
.
_main_app
)
self
.
_hooks_processor
.
stop
=
True
# Stop all the running processes
...
...
nginx.conf
View file @
cc1d564f
server
{
set
$managetests_root
/path/to/root
;
set
$managetests_port
8080
;
listen
80
;
listen
[::]:80
;
server_name
wwwtest.ubuntu-it.org
;
location
/
{
proxy_pass
http://localhost:
8080
;
proxy_pass
http://localhost:
$managetests_port
;
proxy_set_header
Host
$host
;
proxy_set_header
X-Forwarded-For
$proxy_add_x_forwarded_for
;
proxy_set_header
X-Scheme
$scheme
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment