Skip to content

Commit

Permalink
Merge pull request #16 from iqoption/update-gridrouter
Browse files Browse the repository at this point in the history
Update gridrouter version
  • Loading branch information
arslanbekov authored Apr 17, 2018
2 parents 2b8de10 + caaf9fa commit 0e874df
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 47 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
language: python
python: "2.7"
sudo: required
group: deprecated-2017Q4
dist: trusty
services:
- docker
Expand All @@ -11,7 +10,7 @@ before_install:
- sudo apt-get update -qq

install:
- sudo pip install docker-py
- sudo pip install docker
- sudo apt-get install -y sshpass software-properties-common python-software-properties
- sudo pip install ansible
- echo -e 'localhost ansible_connection=local' > tests/inventory
Expand All @@ -27,6 +26,5 @@ script:
| grep -q 'failed=0'
&& (echo 'Failed test: pass' && exit 0)
|| (echo 'Failed test: fail' && exit 1)
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
38 changes: 18 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,61 +12,59 @@ Set up [GridRouter](https://github.com/aerokube/ggr) in docker
#### Variables

```yaml
grid_router_version: 1.4.0 # Install GridRouter version
grid_router_version: 1.5.3 # Install GridRouter version
grid_router_path: /etc/grid-router # Path to GridRouter
grid_router_qouta_path: /etc/grid-router/quota # Path to GridRouter quota
grid_router_qouta_user: selenoid # GridRouter quota user
grid_router_qouta_password: selenoid # GridRouter quota password
grid_router_time_zone: Europe/Moscow # Timezone in container
grid_router_port: 4444 # GridRouter port
grid_router_sctl_version: 1.2.0 # sctl version — https://github.com/seleniumkit/sctl/releases
grid_router_docker_api_version: 1.24 # Docker api version (for GridRouter)
grid_router_host_list: group # Host list for selenoid.xml

grid_router_regions: # Hosts list per region
- name: "region-1"
hosts:
- name: localhost
port: 4444
browser_count: 4
browser_count: 5

grid_router_browsers: # Browser list usage selenoid
- name: "firefox"
defaultVersion: "54.0"
versions:
- "54.0"
- "53.0"
- "52.0"
- name: "chrome"
defaultVersion: "59.0"
versions:
- "59.0"
- "58.0"
- "57.0"
- name: "chrome"
defaultVersion: "65.0"
versions:
- "65.0"
- "64.0"
- "63.0"
- name: "opera"
defaultVersion: "45.0"
defaultVersion: "52.0"
versions:
- "45.0"
- "44.0"
- "43.0"
- "52.0"
- "51.0"
- "50.0"
```
You can override collection browsers `grid_router_browsers` according to your needs.
For example:
```yaml
grid_router_browsers:
- name: "firefox"
defaultVersion: "54.0"
versions:
- "54.0"
- name: "chrome"
defaultVersion: "59.0"
versions:
- "59.0"
- name: "chrome"
defaultVersion: "65.0"
versions:
- "65.0"
- name: "opera"
defaultVersion: "45.0"
defaultVersion: "52.0"
versions:
- "45.0"
- "52.0"
```

All supported browsers see [here](https://github.com/aerokube/selenoid#ready-to-use-browser-images).
Expand Down
26 changes: 12 additions & 14 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
---
grid_router_version: 1.4.0 # Install GridRouter version
grid_router_version: 1.5.3 # Install GridRouter version
grid_router_path: /etc/grid-router # Path to GridRouter
grid_router_qouta_path: /etc/grid-router/quota # Path to GridRouter quota
grid_router_qouta_user: selenoid # GridRouter quota user
grid_router_qouta_password: selenoid # GridRouter quota password
grid_router_time_zone: Europe/Moscow # Timezone in container
grid_router_port: 4444 # GridRouter port
grid_router_sctl_version: 1.2.0 # sctl version — https://github.com/seleniumkit/sctl/releases
grid_router_docker_api_version: 1.24 # Docker api version (for GridRouter)
grid_router_host_list: group # Host list for selenoid.xml

grid_router_regions: # Hosts list per region
- name: "region-1"
hosts:
- name: localhost
port: 4444
browser_count: 4
browser_count: 5

grid_router_browsers: # Browser list usage selenoid
- name: "firefox"
defaultVersion: "54.0"
versions:
- "54.0"
- "53.0"
- "52.0"
- name: "chrome"
defaultVersion: "59.0"
versions:
- "59.0"
- "58.0"
- "57.0"
- name: "chrome"
defaultVersion: "65.0"
versions:
- "65.0"
- "64.0"
- "63.0"
- name: "opera"
defaultVersion: "45.0"
defaultVersion: "52.0"
versions:
- "45.0"
- "44.0"
- "43.0"
- "52.0"
- "51.0"
- "50.0"
12 changes: 2 additions & 10 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
pip:
name: "{{ item.name }}"
with_items:
- { name: docker-py }
- { name: passlib }
- { name: docker }

- name: Grid Router | Download sctl
get_url:
Expand All @@ -28,13 +27,6 @@
- name: Grid Router | Generate quota file
shell: sctl generate --inputFile "{{ grid_router_qouta_path }}/quota_template.json" --outputDirectory "{{ grid_router_qouta_path }}"

- name: Grid Router | Setup quota password
htpasswd:
path: "{{ grid_router_path }}/users.htpasswd"
name: "{{ grid_router_qouta_user }}"
password: "{{ grid_router_qouta_password}}"
mode: 0640

- name: Grid Router | Run Grid Router container
docker_container:
name: grid_router
Expand All @@ -46,6 +38,6 @@
- "{{ grid_router_path }}:{{ grid_router_path }}:ro"
env:
TZ: "{{ grid_router_time_zone }}"
DOCKER_API_VERSION: "{{ grid_router_docker_api_version }}"
ports:
- "{{ grid_router_port }}:{{ grid_router_port }}"
command: ["/usr/bin/ggr", "-listen", ":4444", "-quotaDir", "{{ grid_router_qouta_path }}", "-guests-allowed", "-guest-quota", "{{ grid_router_qouta_user }}"]

0 comments on commit 0e874df

Please sign in to comment.