diff --git a/.travis.yml b/.travis.yml index f649cd4..6799460 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,29 +1,19 @@ sudo: required services: docker -# Cache intermediate Docker layers. For a description of how this works, see: -# https://giorgos.sealabs.net/docker-cache-on-travis-and-docker-112.html -cache: - directories: - - /home/travis/docker/ - env: - matrix: - - VIM_VERSION="7.4" PYTHON_IMAGE=2.7-stretch TAG=vim_74_py2 DOCKER_CACHE_FILE=/home/travis/docker/vim_74_py2.tar.gz - - VIM_VERSION="8.0" PYTHON_IMAGE=2.7-stretch TAG=vim_80_py2 DOCKER_CACHE_FILE=/home/travis/docker/vim_80_py2.tar.gz - - VIM_VERSION="git" PYTHON_IMAGE=2.7-stretch TAG=vim_git_py2 DOCKER_CACHE_FILE=/home/travis/docker/vim_git_py2.tar.gz - - VIM_VERSION="7.4" PYTHON_IMAGE=3.6-stretch TAG=vim_74_py3 DOCKER_CACHE_FILE=/home/travis/docker/vim_74_py3.tar.gz - - VIM_VERSION="8.0" PYTHON_IMAGE=3.6-stretch TAG=vim_80_py3 DOCKER_CACHE_FILE=/home/travis/docker/vim_80_py3.tar.gz - - VIM_VERSION="git" PYTHON_IMAGE=3.6-stretch TAG=vim_git_py3 DOCKER_CACHE_FILE=/home/travis/docker/vim_git_py3.tar.gz - global: - secure: PFU1Md8NuN6SQNjx6SsHX7icS9Tacb0xS0Ue9SHll1U7FNdI90F/gnokR6v+j7sdvoiLkwRSwUXeYUmrZS/d9qq8yiRxuqcj/Y0TfHVKqcLXXV/m9xWAN2UKRVF7Z1neerznk52Roo3IRqwgd9U+6d3bTthHKKYg4azBqTM7AFE= -before_install: docker/load_docker_cache.sh + - VIM_VERSION="7.4" PYTHON_IMAGE=2.7-stretch TAG=vim_74_py2 + - VIM_VERSION="8.0" PYTHON_IMAGE=2.7-stretch TAG=vim_80_py2 + - VIM_VERSION="git" PYTHON_IMAGE=2.7-stretch TAG=vim_git_py2 + - VIM_VERSION="7.4" PYTHON_IMAGE=3.6-stretch TAG=vim_74_py3 + - VIM_VERSION="8.0" PYTHON_IMAGE=3.6-stretch TAG=vim_80_py3 + - VIM_VERSION="git" PYTHON_IMAGE=3.6-stretch TAG=vim_git_py3 + install: - - docker build -t ultisnips:${TAG} --build-arg PYTHON_IMAGE=${PYTHON_IMAGE} --build-arg VIM_VERSION=${VIM_VERSION} --build-arg GITHUB_ACCESS_TOKEN=${GITHUB_ACCESS_TOKEN} . + - docker build -t ultisnips:${TAG} --build-arg PYTHON_IMAGE=${PYTHON_IMAGE} --build-arg VIM_VERSION=${VIM_VERSION} . script: - docker run -it ultisnips:${TAG} docker/run_tests.sh - - docker/save_docker_cache.sh notifications: webhooks: diff --git a/Dockerfile b/Dockerfile index 91ae29e..e47a295 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,6 @@ ARG PYTHON_IMAGE FROM python:${PYTHON_IMAGE} ARG VIM_VERSION -ARG GITHUB_ACCESS_TOKEN COPY docker/install_packages.sh src/scripts/ RUN src/scripts/install_packages.sh @@ -12,26 +11,9 @@ RUN src/scripts/download_vim.sh COPY docker/build_vim.sh src/scripts/ RUN src/scripts/build_vim.sh -# We clone the plugins we currently depend on manually here. Initially we check -# if their master has changed since last time we build, this will invalidate -# the cache. -RUN mkdir -p /tmp/UltiSnips_test_vim_plugins - -ADD https://api.github.com/repos/tpope/vim-pathogen/git/refs/heads/master?access_token=$GITHUB_ACCESS_TOKEN \ - /src/scripts/vim-pathogen_version.json -RUN git clone --recursive --depth 1 https://github.com/tpope/vim-pathogen /tmp/UltiSnips_test_vim_plugins/vim-pathogen - -ADD https://api.github.com/repos/ervandew/supertab/git/refs/heads/master?access_token=$GITHUB_ACCESS_TOKEN \ - /src/scripts/supertab_version.json -RUN git clone --recursive --depth 1 https://github.com/ervandew/supertab /tmp/UltiSnips_test_vim_plugins/supertab - -# Unidecode is not a Vim plugin, but a Python library we depend on. We also -# install the latest version through pip. But we still use GitHub activity as a -# marker to invalidate the installation step, just to make sure we occasionally -# reinstall a new version. -ADD https://api.github.com/repos/avian2/unidecode/git/refs/heads/master?access_token=$GITHUB_ACCESS_TOKEN \ - /src/scripts/unidecode_version.json RUN pip install unidecode COPY . /src/UltiSnips WORKDIR /src/UltiSnips + +RUN ./test_all.py --clone-plugins diff --git a/docker/load_docker_cache.sh b/docker/load_docker_cache.sh deleted file mode 100755 index 5e243ce..0000000 --- a/docker/load_docker_cache.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -o errexit -set -o verbose -set -o pipefail - -# See -# https://giorgos.sealabs.net/docker-cache-on-travis-and-docker-112.html -if [ -f ${DOCKER_CACHE_FILE} ]; then - gunzip -c ${DOCKER_CACHE_FILE} | docker load; -fi diff --git a/docker/save_docker_cache.sh b/docker/save_docker_cache.sh deleted file mode 100755 index 38c13a6..0000000 --- a/docker/save_docker_cache.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -set -o errexit -set -o verbose -set -o pipefail - -# Cache intermediate Docker layers. For a description of how this works, see: -# https://giorgos.sealabs.net/docker-cache-on-travis-and-docker-112.html -if [[ ${TRAVIS_BRANCH} == "master" ]] && [[ ${TRAVIS_PULL_REQUEST} == "false" ]]; then - mkdir -p $(dirname ${DOCKER_CACHE_FILE}) - IMAGE_NAMES=$(docker history -q ultisnips:${TAG} | grep -v '') - docker save ${IMAGE_NAMES} | gzip > ${DOCKER_CACHE_FILE}.new - mv ${DOCKER_CACHE_FILE}.new ${DOCKER_CACHE_FILE} -fi