Skip to content

Commit

Permalink
Merge pull request #10 from EA31337/dev
Browse files Browse the repository at this point in the history
Development fixes
  • Loading branch information
kenorb authored Feb 2, 2024
2 parents b68c1bb + 52fe88c commit 8a1e6e4
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 26 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
Pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ hashFiles('.pre-commit-config.yaml') }}
- uses: actions/setup-python@v3
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected]
9 changes: 6 additions & 3 deletions .github/workflows/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,20 @@ jobs:
fail-fast: false
matrix:
scenario:
- mt4
- default
- mt4
- mt5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
path: "${{ github.repository }}"
- uses: gofrolist/molecule-action@v2
env:
ANSIBLE_FORCE_COLOR: '1'
ANSIBLE_STDOUT_CALLBACK: debug
with:
molecule_args: --scenario-name ${{ matrix.scenario }}
molecule_command: test
molecule_options: --verbose
molecule_working_dir: "${{ github.repository }}"
timeout-minutes: 30
timeout-minutes: 20
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
repos:

- repo: https://github.com/ansible-community/ansible-lint
rev: v6.22.0
rev: v6.22.2
hooks:
- id: ansible-lint

Expand All @@ -19,7 +19,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/igorshubovych/markdownlint-cli.git
rev: v0.38.0
rev: v0.39.0
hooks:
- id: markdownlint

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Ansible role to install MetaTrader platform.

## Install

To install this role, you can use the following terminal command:

ansible-galaxy install git+https://github.com/EA31337/ansible-role-metatrader.git

## Variables

- `metatrader_setup_url`
Expand Down
2 changes: 1 addition & 1 deletion build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
container_name: ubuntu-worker
docker_image: ubuntu
tasks:
- name: Pull image # noqa: syntax-check[specific]
- name: Pull image # noqa: syntax-check[unknown-module]
community.docker.docker_image:
name: '{{ docker_image }}'
source: pull
Expand Down
11 changes: 8 additions & 3 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,28 @@ collections:
- community.docker
dependencies:
- name: ea31337.wine
role: EA31337.wine
role: ea31337.wine
scm: git
src: https://github.com/EA31337/ansible-role-wine.git
vars:
wine_install_winetricks: true
version: dev
when: ansible_os_family != "Windows"
- name: ea31337.xvfb
role: EA31337.xvfb
role: ea31337.xvfb
scm: git
src: https://github.com/EA31337/ansible-role-xvfb.git
version: dev
when: ansible_os_family != "Windows"
galaxy_info:
author: EA31337 Ltd
description: Role to install MetaTrader platform.
description: |
Role to install MetaTrader platform.
galaxy_tags:
- emulator
- forex
- trading
- linux
- windows
issue_tracker_url: https://github.com/EA31337/ansible-role-metatrader
license: GPLv3
Expand Down
4 changes: 2 additions & 2 deletions molecule/default/requirements.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Molecule's requirements file.
---
- name: EA31337.wine
- name: ea31337.wine
scm: git
src: git+https://github.com/EA31337/ansible-role-wine.git
version: dev
- name: EA31337.xvfb
- name: ea31337.xvfb
scm: git
src: https://github.com/EA31337/ansible-role-xvfb.git
version: dev
4 changes: 2 additions & 2 deletions requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ collections:
- name: community.docker
version: ">=3.4.0,<4.0.0"
roles:
- name: EA31337.wine
- name: ea31337.wine
scm: git
src: git+https://github.com/EA31337/ansible-role-wine.git
version: dev
- name: EA31337.xvfb
- name: ea31337.xvfb
scm: git
src: git+https://github.com/EA31337/ansible-role-xvfb.git
version: dev
16 changes: 8 additions & 8 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
---
- name: Validate variables
- name: Validates variables
ansible.builtin.assert:
that:
- metatrader_setup_url | length > 0
- name: Check if platform is already installed
- name: Checks if platform is already installed
register: file_mt_installed_exists
ansible.builtin.stat:
path: ~/.wine/.installed-mt{{ metatrader_version }}
when:
- ansible_os_family != "Windows"
- name: Ensure Curl is installed
- name: Ensures Curl is present
ansible.builtin.package:
name: curl
state: present
when:
- ansible_os_family != "Windows"
- not file_mt_installed_exists.stat.exists
- name: Install MetaTrader (via Winetricks)
- name: Installs MetaTrader (via Winetricks)
when:
- ansible_os_family != "Windows"
- not file_mt_installed_exists.stat.exists
block:
- name: Install verb file
- name: Ensures verb installation file is present
ansible.builtin.template:
src: mt{{ metatrader_version }}_install.verb.j2
dest: /tmp/mt{{ metatrader_version }}_install.verb
mode: "0640"
- name: Install MetaTrader (via verb file)
- name: Ensures MetaTrader is installed (via verb file)
ansible.builtin.shell:
# noqa command-instead-of-shell
cmd: >
Expand All @@ -37,9 +37,9 @@
creates: ~/.wine/.installed-mt{{ metatrader_version }}
args:
executable: /bin/bash
- name: Remove verb file
- name: Ensures verb installation file is absent
ansible.builtin.file:
path: /tmp/mt{{ metatrader_version }}_install.verb
state: absent
- name: Verify
- name: Verifies
ansible.builtin.include_tasks: verify.yml
4 changes: 2 additions & 2 deletions tasks/verify.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: Check if Meta Terminal exists
- name: Checks if Meta Terminal exists
changed_when: false
failed_when: find_mt_res.matched == 0
ansible.builtin.find:
Expand All @@ -8,7 +8,7 @@
recurse: true
register: find_mt_res
when: ansible_os_family != "Windows"
- name: Check if Meta Editor exists
- name: Checks if Meta Editor exists
changed_when: false
failed_when: find_mt_res.matched == 0
ansible.builtin.find:
Expand Down

0 comments on commit 8a1e6e4

Please sign in to comment.