Giter VIP home page Giter VIP logo

rfdocker's Introduction

rfdocker

Robot Framework in a lightweight Alpine Linux based Docker container.

Why?

  1. To take Robot Framework into use without (having sudo to do) installations on the host
  2. To avoid virtualenvs, etc. to deal with conflicting dependencies of the test libraries
  3. To be able to install Robot Framework and run the tests with one command

Usage

Download rfdocker and Dockerfile to where your tests/ directory is:

curl https://raw.githubusercontent.com/asyrjasalo/rfdocker/master/rfdocker -o rfdocker || \
wget https://raw.githubusercontent.com/asyrjasalo/rfdocker/master/rfdocker -O rfdocker && \
chmod +x rfdocker && \
curl https://raw.githubusercontent.com/asyrjasalo/rfdocker/master/Dockerfile -o Dockerfile || \
wget https://raw.githubusercontent.com/asyrjasalo/rfdocker/master/Dockerfile -O Dockerfile && \
echo "Done."

Then:

./rfdocker

The Robot Framework output files are put in the same directory under results/.

Robot Framework arguments

Any arguments are forwarded to robot inside the container, e.g. the output directory can be renamed with:

./rfdocker --outputdir results/$(date +%Y-%m-%dT%H:%M:%S) tests/

External test libraries

Put the external test libraries to requirements.txt and uncomment the lines in Dockerfile. The packages are automatically installed inside the container whenever rfdocker is ran.

If the external test libraries require OS-level dependencies, you may need to add installation of these to Dockerfile (before running pip).

On Alpine Linux, you can install packages with RUN apk add --update {{packagename}}. See Alpine Linux wiki page for more information, and docker/Dockerfile.base in this repository as an example.

Customizing docker arguments

You can pass variable BUILD_ARGS to rfdocker to customize docker build arguments, and variable BUILD_DIR to override the path of the directory where Dockerfile and requirements.txt are.

Similarly, you can pass variable RUN_ARGS to rfdocker to e.g. define additional volume mappings for CI, to persist results/ outside the Jenkins job's workspace, or to allow connecting to your host machine from the container (RUN_ARGS="--network=host").

Contributing

Git branches 'master' and 'python2' are to build images for Robot Framework on Python 3 and 2 series, respectively. The both images are hosted in Docker Hub, robotframework/rfdocker. The version numbers correspond to the Robot Framework releases.

In addition to version numbered tags, tag 'latest' references to the latest Robot Framework final (no rcs) on Python 3 series - please use tag 'latest' carefully though, in general with Docker images, as it is possible that the upcoming Robot Framework versions could introduce some backwards incompatible changes in the future, without you noticing this as easily as when using explicit version numbers.

The images are built using rfdocker itself, with the help of scripts/. You may benefit from these scripts for distributing your own images as well.

To build a new image:

scripts/build

The Robot Framework version is read from file scripts/release_name, and Python version from file scripts/python_version.

To push the image to Docker registry (and create a git tag after release_name):

scripts/release https://your.private.registry.com:5000/rfdocker

For pushing to Docker Hub, you can use:

scripts/release {{organization}}/rfdocker

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.