Skip to content

Commit

Permalink
Merge pull request #9 from iqoption/update-selenoid
Browse files Browse the repository at this point in the history
Update selenoid
  • Loading branch information
arslanbekov authored Apr 17, 2018
2 parents 5fbec81 + ae7b8b2 commit d26b04f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,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 apt-add-repository -y ppa:ansible/ansible
- sudo apt-get update -qq
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ Set up [selenoid](https://github.com/aerokube/selenoid) in docker
#### Variables

```yaml
selenoid_version: 1.4.0
selenoid_cm_version: 1.3.1
selenoid_docker_api_version: 1.24
selenoid_limit: 4
selenoid_version: 1.6.0
selenoid_cm_version: 1.4.2
selenoid_limit: 5
selenoid_tmpfs: 128
selenoid_config_dir: /etc/selenoid
selenoid_listen_port: 4444
Expand All @@ -25,6 +24,8 @@ selenoid_browsers:
- firefox
- opera
- chrome
selenoid_video_host_output_dir: /var/lib/selenoid/video
selenoid_video_container_output_dir: /opt/selenoid/video
```
#### Example
Expand Down
9 changes: 5 additions & 4 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
selenoid_version: 1.4.0 # Install selenoid version
selenoid_cm_version: 1.3.1 # Install configuration manager version
selenoid_docker_api_version: 1.24 # Docker api version (for Selenoid)
selenoid_limit: 4 # Total number of simultaneously running containers http://aerokube.com/selenoid/latest/#_recommended_docker_settings
selenoid_version: 1.6.0 # Install selenoid version
selenoid_cm_version: 1.4.2 # Install configuration manager version
selenoid_limit: 5 # Total number of simultaneously running containers http://aerokube.com/selenoid/latest/#_recommended_docker_settings
selenoid_tmpfs: 128 # Add in-memory filesystem (tmpfs) to container http://aerokube.com/selenoid/latest/#_other_optional_fields
selenoid_config_dir: /etc/selenoid # Selenoid configuration dir
selenoid_listen_port: 4444 # Listen port
Expand All @@ -12,3 +11,5 @@ selenoid_browsers: # What browsers to download
- firefox
- opera
- chrome
selenoid_video_host_output_dir: /var/lib/selenoid/video # Dir for save video in host path
selenoid_video_container_output_dir: /opt/selenoid/video # Dir for save video in container (default: /opt/selenoid/video)
14 changes: 10 additions & 4 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pip:
name: "{{ item.name }}"
with_items:
- { name: docker-py }
- { name: docker }

- name: Selenoid | Check selenoid container exist
shell: 'docker ps -aq --filter "name={{ item }}"'
Expand All @@ -16,24 +16,30 @@
with_items: '{{ found_containers.results }}'
when: item.stdout

- name: Selenoid | Create video folder
file:
path: "{{ selenoid_video_host_output_dir }}"
state: directory
mode: 0755

- name: Selenoid | Run CM container, download browser images and run selenoid
docker_container:
name: cm
image: "aerokube/cm:{{ selenoid_cm_version }}"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "/root:/root"
- "{{ selenoid_video_host_output_dir }}:{{ selenoid_video_container_output_dir }}"
env:
TZ: "{{ selenoid_time_zone }}"
OVERRIDE_HOME: "/root"
DOCKER_API_VERSION: "{{ selenoid_docker_api_version }}"
command: >
selenoid start
--config-dir {{ selenoid_config_dir }}
--version {{ selenoid_version }}
--tmpfs {{ selenoid_tmpfs }}
--env DOCKER_API_VERSION={{ selenoid_docker_api_version }}
--browsers {% for browser in selenoid_browsers -%}{{ browser }}{%- if not loop.last -%},{%- endif -%}{%- endfor %}
--last-versions {{ selenoid_browsers_last_versions }}
--force
--args "-limit {{ selenoid_limit }} -listen :{{ selenoid_listen_port }} -conf {{ selenoid_config_dir }}/browsers.json"
--vnc
--args "-limit {{ selenoid_limit }} -listen :{{ selenoid_listen_port }} -video-output-dir={{ selenoid_video_container_output_dir }} -conf {{ selenoid_config_dir }}/browsers.json"

0 comments on commit d26b04f

Please sign in to comment.