File: Dockerfile

package info (click to toggle)
vim-link-vim 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 424 kB
  • sloc: sh: 74; makefile: 2
file content (45 lines) | stat: -rw-r--r-- 1,219 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Run tests in a Docker container to avoid any interference from existing
# settings and plugins.

ARG BASE_IMAGE=ubuntu:latest
FROM ${BASE_IMAGE}

ARG DEBIAN_FRONTEND=noninteractive

# Install packages
RUN apt-get update && \
  apt-get install --yes curl git pipx vim neovim && \
  rm -rf /var/lib/apt/lists/*

# Ensure that `vim` doesn't point to `nvim` on Ubuntu
RUN update-alternatives --set vim /usr/bin/vim.basic

RUN useradd --create-home vimmer
USER vimmer

WORKDIR /home/vimmer

# Install linter
RUN pipx install git+https://github.com/Vimjas/vint.git

# Copy Vim/Neovim configuration
COPY --chown=vimmer:vimmer test/docker.vimrc .vimrc
COPY --chown=vimmer:vimmer test/docker.vimrc .config/nvim/init.vim

# Install `vim-plug` plugin manager, then install plugins
RUN vim +qall && vim -es -u .vimrc -i NONE +PlugInstall +qall
RUN nvim +qall && nvim -E -s -u .config/nvim/init.vim +PlugInstall +qall

# Copy (possibly modified) plugin, instead of pulling latest release from GitHub
COPY --chown=vimmer:vimmer ./ plugged/link.vim/

WORKDIR /home/vimmer/plugged/link.vim

# Lint
RUN /home/vimmer/.local/bin/vint ./

# Run tests
RUN vim '+Vader! **/*.vader'
RUN nvim '+Vader! **/*.vader'

CMD [ "echo", "Success" ]