From 1546022088a06e2f10e6e18aca842bcc1fd95116 Mon Sep 17 00:00:00 2001 From: Holger Rapp Date: Tue, 3 Apr 2018 21:52:35 +0200 Subject: [PATCH] Make makefile a bit more powerful. --- Dockerfile.repro | 6 +++-- Makefile | 24 +++++++++++++++++++ .../docker_vimrc.vim | 2 +- 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 Makefile rename doc/minimal_vimrc.vim => scripts/docker_vimrc.vim (90%) diff --git a/Dockerfile.repro b/Dockerfile.repro index 3f8da29..c94e011 100644 --- a/Dockerfile.repro +++ b/Dockerfile.repro @@ -1,8 +1,10 @@ -FROM ultisnips +ARG BASE_IMAGE + +FROM ultisnips:${BASE_IMAGE} RUN curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -ADD doc/minimal_vimrc.vim /root/.vimrc +ADD scripts/docker_vimrc.vim /root/.vimrc RUN vim -c 'PlugInstall | qa' diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..bff99cb --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ + +# Test images as run on CI. +image_vim_74_py2: + docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=2.7-stretch --build-arg VIM_VERSION=7.4 . +image_vim_80_py2: + docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=2.7-stretch --build-arg VIM_VERSION=8.0 . +image_vim_git_py2: + docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=2.7-stretch --build-arg VIM_VERSION=git . +image_vim_74_py3: + docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.6-stretch --build-arg VIM_VERSION=7.4 . +image_vim_80_py3: + docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.6-stretch --build-arg VIM_VERSION=8.0 . +image_vim_git_py3: + docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.6-stretch --build-arg VIM_VERSION=git . + +image_repro: image_vim_80_py3 + docker build -t ultisnips:repro --build-arg BASE_IMAGE=$< -f Dockerfile.repro . + +# A reproduction image that drops you into a naked environment, +# with a Vim having UltiSnips and vim-snippets configured. See +# scripts/docker_vimrc.vim for the full vimrc. Need to run `make +# image_repro` before this will work. +repro: + docker run -it -v $(pwd):/src/UltiSnips ultisnips:repro /bin/bash diff --git a/doc/minimal_vimrc.vim b/scripts/docker_vimrc.vim similarity index 90% rename from doc/minimal_vimrc.vim rename to scripts/docker_vimrc.vim index 9dee397..0cb3d87 100644 --- a/doc/minimal_vimrc.vim +++ b/scripts/docker_vimrc.vim @@ -1,6 +1,6 @@ call plug#begin('~/.vim/plugged') -Plug 'SirVer/ultisnips' +Plug '/src/UltiSnips' Plug 'honza/vim-snippets' let g:UltiSnipsExpandTrigger=""