├── .travis.yml ├── .zshrc ├── Dockerfile ├── README.md ├── composer.json └── project ├── behat.yml ├── bootstrap └── FeatureContext.php └── features └── travis.feature /.travis.yml: -------------------------------------------------------------------------------- 1 | language: bash 2 | sudo: required 3 | services: 4 | - docker 5 | script: 6 | - docker build -t tvial/behat . 7 | - docker run -ti -h docker-behat -v "$(pwd)/project":/root/project tvial/behat behat -------------------------------------------------------------------------------- /.zshrc: -------------------------------------------------------------------------------- 1 | # Path to your oh-my-zsh installation. 2 | export ZSH=$HOME/.oh-my-zsh 3 | 4 | # Set name of the theme to load. 5 | # Look in ~/.oh-my-zsh/themes/ 6 | # Optionally, if you set this to "random", it'll load a random theme each 7 | # time that oh-my-zsh is loaded. 8 | ZSH_THEME="robbyrussell" 9 | 10 | # Example aliases 11 | # alias zshconfig="mate ~/.zshrc" 12 | # alias ohmyzsh="mate ~/.oh-my-zsh" 13 | 14 | # Set this to use case-sensitive completion 15 | # CASE_SENSITIVE="true" 16 | 17 | # Uncomment this to disable bi-weekly auto-update checks 18 | # DISABLE_AUTO_UPDATE="true" 19 | 20 | # Uncomment to change how often to auto-update? (in days) 21 | # export UPDATE_ZSH_DAYS=13 22 | 23 | # Uncomment following line if you want to disable colors in ls 24 | # DISABLE_LS_COLORS="true" 25 | 26 | # Uncomment following line if you want to disable autosetting terminal title. 27 | # DISABLE_AUTO_TITLE="true" 28 | 29 | # Uncomment following line if you want to disable command autocorrection 30 | # DISABLE_CORRECTION="true" 31 | 32 | # Uncomment following line if you want red dots to be displayed while waiting for completion 33 | # COMPLETION_WAITING_DOTS="true" 34 | 35 | # Uncomment following line if you want to disable marking untracked files under 36 | # VCS as dirty. This makes repository status check for large repositories much, 37 | # much faster. 38 | # DISABLE_UNTRACKED_FILES_DIRTY="true" 39 | 40 | # Uncomment following line if you want to the command execution time stamp shown 41 | # in the history command output. 42 | # The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" 43 | # HIST_STAMPS="mm/dd/yyyy" 44 | 45 | # Would you like to use another custom folder than $ZSH/custom? 46 | # ZSH_CUSTOM=/path/to/new-custom-folder 47 | 48 | # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) 49 | # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ 50 | # Example format: plugins=(rails git textmate ruby lighthouse) 51 | plugins=(git docker) 52 | 53 | source $ZSH/oh-my-zsh.sh 54 | 55 | # User configuration 56 | 57 | # export PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/behat/composer/bin" 58 | # export MANPATH="/usr/local/man:$MANPATH" 59 | 60 | # You may need to manually set your language environment 61 | # export LANG=en_US.UTF-8 62 | 63 | # # Preferred editor for local and remote sessions 64 | # if [[ -n $SSH_CONNECTION ]]; then 65 | # export EDITOR='vim' 66 | # else 67 | # export EDITOR='mvim' 68 | # fi 69 | 70 | # Compilation flags 71 | # export ARCHFLAGS="-arch x86_64" 72 | 73 | # ssh 74 | # export SSH_KEY_PATH="~/.ssh/dsa_id" 75 | 76 | # Prompt 77 | local ret_status="%(?:%{$fg_bold[green]%}➜ [ %m ]:%{$fg_bold[red]%}➜ [ %m ]%s)" 78 | PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' 79 | 80 | ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" 81 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 82 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" 83 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" 84 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | MAINTAINER Thomas VIAL 3 | 4 | # Update and install packages 5 | RUN apk update 6 | RUN apk add --no-cache php5-cli php5-curl php5-json php5-phar php5-openssl php5-ctype php5-dom curl zsh git && rm -rf /var/cache/apk/* 7 | 8 | # Clone oh-my-zsh 9 | RUN git clone https://github.com/robbyrussell/oh-my-zsh.git /root/.oh-my-zsh/ 10 | 11 | # Install Behat 12 | RUN mkdir -p /root/composer 13 | ADD composer.json /root/composer/composer.json 14 | RUN cd /root/composer && curl http://getcomposer.org/installer | php 15 | RUN cd /root/composer && php composer.phar install --prefer-source 16 | 17 | # Create a new zsh configuration from the provided template 18 | ADD .zshrc /root/.zshrc 19 | 20 | # Set Workdir and ENV 21 | RUN mkdir -p /root/project 22 | WORKDIR /root/project 23 | ENV PATH $PATH:/root/composer/bin/ 24 | CMD ["behat"] 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # docker-behat 2 | 3 | [![Build Status](https://travis-ci.org/tomav/docker-behat.svg?branch=master)](https://travis-ci.org/tomav/docker-behat) 4 | 5 | This repository is the source of `tvial/behat` which brings: 6 | - a basic shell with oh-my-zsh 7 | - php5-cli with PHP 5.5 8 | - behat 3.0 / mink 1.5 9 | - all needed dependencies 10 | 11 | ## Install 12 | 13 | docker pull tvial/behat 14 | 15 | ## Usage 16 | 17 | docker run -ti -h docker-behat -v "$(pwd)/project":/root/project tvial/behat zsh 18 | 19 | You should see a prompt containing `[ docker-behat ]` and have `behat` command available. 20 | 21 | ## Build 22 | 23 | If you need adapt the project to your needs, clone, modify the `Dockerfile` and from the source directory, run: 24 | 25 | docker build -t tvial/behat . 26 | 27 | Also available via [Docker Index](https://index.docker.io/u/tvial/behat/). 28 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "behat/behat": "~3.0", 4 | "behat/mink": "~1.5", 5 | "behat/mink-selenium2-driver": "*", 6 | "behat/mink-extension": "*", 7 | "behat/mink-goutte-driver": "*", 8 | "phpunit/phpunit": "~3.7" 9 | }, 10 | "minimum-stability": "stable", 11 | "config": { 12 | "bin-dir": "bin/" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /project/behat.yml: -------------------------------------------------------------------------------- 1 | default: 2 | autoload: %paths.base%/bootstrap/ 3 | extensions: 4 | Behat\MinkExtension: 5 | base_url: https://travis-ci.com/ 6 | default_session: goutte 7 | goutte: ~ 8 | -------------------------------------------------------------------------------- /project/bootstrap/FeatureContext.php: -------------------------------------------------------------------------------- 1 |