Skip to content

Commit

Permalink
Installs platform via Ansible
Browse files Browse the repository at this point in the history
  • Loading branch information
kenorb committed Jan 27, 2024
1 parent 281f67c commit 98083d0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
35 changes: 15 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Set the base Ubuntu image.
FROM ubuntu:bionic AS ubuntu-base
FROM ubuntu:latest AS ubuntu-base

Check failure on line 2 in Dockerfile

View workflow job for this annotation

GitHub Actions / Hadolint

DL3007 warning: Using latest is prone to errors if the image will ever update. Pin the version explicitly to a release tag
ENV DEBIAN_FRONTEND noninteractive

# Setup the default user.
Expand All @@ -11,25 +11,19 @@ WORKDIR /home/ubuntu
FROM ubuntu-base AS ubuntu-provisioned
USER root

# Build-time variables.
ARG HTTPS_PROXY
ARG HTTP_PROXY
ARG PROVISION_AHK=0
ARG PROVISION_CHARLES=0
ARG PROVISION_MONO=1
ARG PROVISION_SSH=0
ARG PROVISION_SUDO=1
ARG PROVISION_VNC=1

# Provision container image.
COPY ansible /opt/ansible
COPY scripts /opt/scripts
ENV PATH $PATH:/opt/scripts:/opt/scripts/py
ENV PROVISION_HASH KwFCBBn659lGNLNiIGd5131XnknI
RUN provision.sh
#ENV PROVISION_HASH KwFCBBn659lGNLNiIGd5131XnknI
#RUN provision.sh

# Clean up.
RUN find /var/lib/apt/lists -type f -delete && \
find /tmp -mindepth 1 '(' -type d -o -type f ')' -delete
RUN apt update \

Check failure on line 21 in Dockerfile

View workflow job for this annotation

GitHub Actions / Hadolint

DL3027 warning: Do not use apt as it is meant to be a end-user tool, use apt-get or apt-cache instead
&& apt -qqq install ansible git \
&& ansible-galaxy install git+https://github.com/EA31337/ansible-role-mt-runner.git,dev \
&& ansible-playbook -i "localhost," -c local /opt/ansible/mt-install.yml -v \
&& rm -fr ~/.ansible /tmp/* \
&& find /var/lib/apt/lists -type f -delete

# Uses ubuntu as default user.
USER ubuntu
Expand All @@ -52,9 +46,9 @@ VOLUME $BT_DEST
FROM ea-tester-base AS ea-tester-with-mt4

# Install platform.
ARG MT_VER=4
RUN eval.sh install_mt $MT_VER && \
run_backtest.sh -s PrintPaths -v
RUN ansible-playbook -i "localhost," -c local -e metatrader_version=4 /opt/ansible/mt-install.yml -v \
#ARG MT_VER=4
#RUN eval.sh install_mt $MT_VER && run_backtest.sh -s PrintPaths -v

# Clean up.
RUN eval.sh clean_bt && \
Expand All @@ -68,7 +62,8 @@ FROM ea-tester-base AS ea-tester-with-mt5
# Install platform.
ARG MT_VER=5
ENV MT_VER $MT_VER
RUN eval.sh install_mt $MT_VER
RUN ansible-playbook -i "localhost," -c local -e metatrader_version=5 /opt/ansible/mt-install.yml -v \
#RUN eval.sh install_mt $MT_VER
#RUN run_backtest.sh -s PrintPaths -v

# Clean up.
Expand Down
3 changes: 3 additions & 0 deletions ansible/mt-install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- hosts: localhost

Check warning on line 1 in ansible/mt-install.yml

View workflow job for this annotation

GitHub Actions / Pre-commit

1:1 [document-start] missing document start "---"
roles:
- ea31337.metatrader

0 comments on commit 98083d0

Please sign in to comment.