Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@ sudo: required
services:
- docker

before_script: |
cd example
make test-setup

script: |
make test
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
.PHONY: build

.PHONY: build test

build:
docker build -t "tweekmonster/vim-testbed" .

# test: build the base image and then the example image on top, running tests
# therein.
DOCKER_BASE_IMAGE:=vim-testbed-base
DOCKER_EXAMPLE_IMAGE:=vim-testbed-example
test:
docker build -t "$(DOCKER_BASE_IMAGE)" . \
&& cd example \
&& docker build -t "$(DOCKER_EXAMPLE_IMAGE)" . \
&& make test IMAGE=$(DOCKER_EXAMPLE_IMAGE)
7 changes: 7 additions & 0 deletions example/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM vim-testbed-base

RUN install_vim -name vim-precise -tag v7.3.429 -build \
-name vim-trusty -tag v7.4.052 -build \
-name vim-vivid -tag v7.4.488 -build \
-name vim-wily -tag v7.4.712 -build \
-name vim-xenial -tag v7.4.963 -build \
18 changes: 9 additions & 9 deletions example/Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
IMAGE ?= tweekmonster/ubuntu-vims
PLUGINS = test/plugins
IMAGE = tweekmonster/ubuntu-vims
DOCKER = docker run -it --rm -v $(PWD):/testplugin -v $(PWD)/test:/home "$(IMAGE)"

test-setup:
$(PLUGINS)/vader.vim:
mkdir -p $(PLUGINS)
docker pull tweekmonster/ubuntu-vims
cd $(PLUGINS) && git clone https://github.com/junegunn/vader.vim.git

test:
$(DOCKER) vim-precise '+Vader! test/*'
$(DOCKER) vim-trusty '+Vader! test/*'
$(DOCKER) vim-vivid '+Vader! test/*'
$(DOCKER) vim-wily '+Vader! test/*'
$(DOCKER) vim-xenial '+Vader! test/*'
test-setup: $(PLUGINS)/vader.vim
docker images -q $(IMAGE) || docker pull $(IMAGE)

test: test-setup
for vim in $$(docker run --rm $(IMAGE) ls /vim-build/bin | grep -E '^n?vim'); do \
$(DOCKER) $$vim '+Vader! test/*'; \
done

.PHONY: test-setup test
2 changes: 2 additions & 0 deletions scripts/install_vim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ while [ $# -gt 0 ]; do
# expects a -build flag to signal the start of a build. This way,
# installing all Vim versions becomes one layer.
# Side note: tried docker-squash and it didn't seem to do anything.
echo "=== building: NAME=$NAME, TAG=$TAG, PYTHON=$PYTHON, RUBY=$RUBY, LUA=$LUA ==="
build
NAME=""
TAG=""
Expand All @@ -116,6 +117,7 @@ while [ $# -gt 0 ]; do
shift
done

echo "Pruning packages and dirs.."
apk del vim-build
rm -rf /vim/*
rm -rf /var/cache/apk/* /tmp/* /var/tmp/*