From da68dcf79bd6eae7ec9453150549c7cb801c019c Mon Sep 17 00:00:00 2001 From: Costa Shapiro Date: Sun, 4 Aug 2024 00:17:19 +0300 Subject: [PATCH] added Docker'ised dev env support --- README.md | 4 ++++ bin/test | 11 +++++++++++ test/Dockerfile | 15 +++++++++++++++ test/docker-compose.yml | 6 ++++++ 4 files changed, 36 insertions(+) create mode 100755 bin/test create mode 100644 test/Dockerfile create mode 100644 test/docker-compose.yml diff --git a/README.md b/README.md index 6d5db03..33212b3 100644 --- a/README.md +++ b/README.md @@ -206,6 +206,10 @@ Contributing - ```rake acceptance``` - ```pronto run``` + Alternatively, if you're in a [Docker](https://www.docker.com)ised environment, + don't care about installing anything locally, and don't really need __pronto__ + -- just run `bin/test` instead. + 8. Commit your changes - ```git commit -am "Your commit message"``` diff --git a/bin/test b/bin/test new file mode 100755 index 0000000..4b86921 --- /dev/null +++ b/bin/test @@ -0,0 +1,11 @@ +#!/bin/bash -e +test "$#" -ne 0 && echo "Unsupported args: $@" >&2 && exit 145 +cd "$( dirname "${BASH_SOURCE[0]}" )"/.. + +export COMPOSE_FILE=test/docker-compose.yml +export COMPOSE_PROJECT_NAME=highline_dev + +docker-compose rm -svf +docker-compose build --force-rm + +docker-compose run --rm tester && docker-compose rm -svf || ( docker-compose logs && exit 1 ) diff --git a/test/Dockerfile b/test/Dockerfile new file mode 100644 index 0000000..bbb347b --- /dev/null +++ b/test/Dockerfile @@ -0,0 +1,15 @@ +FROM ruby + +WORKDIR /highline + + +RUN bash -ec 'apt update; apt -y install cmake' + +ADD Gemfile highline.gemspec .git* ./ +ADD lib/highline/version.rb ./lib/highline/version.rb +RUN bundle install + +ADD . . + +ENTRYPOINT ["bundle", "exec"] +CMD ["bash", "-ec", "rake test; rake acceptance"] diff --git a/test/docker-compose.yml b/test/docker-compose.yml new file mode 100644 index 0000000..994290a --- /dev/null +++ b/test/docker-compose.yml @@ -0,0 +1,6 @@ +version: '2.1' +services: + tester: + build: + context: .. + dockerfile: test/Dockerfile