File: docker

package info (click to toggle)
hub 2.14.2~ds1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,376 kB
  • sloc: sh: 1,049; ruby: 857; makefile: 89
file content (20 lines) | stat: -rwxr-xr-x 501 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
# Usage: script/docker [<cucumber-args>]
set -e

container=hub-test
workdir=/home/app/workdir

docker build -t "$container" .

docker run -it --rm -v "$PWD":"$workdir" -w "$workdir" "$container" \
  /bin/bash -c "
# Enables running WEBrick server (see local_server.rb)
# https://stackoverflow.com/a/45899937/11687
cp /etc/hosts /tmp/hosts.new \
	&& sed -i 's/::1\\tlocalhost/::1/' /tmp/hosts.new \
	&& sudo cp -f /tmp/hosts.new /etc/hosts || exit 1

go test ./...
bundle exec cucumber $@
"