Remove travis caching and avoid rate limiting. (#962)

The caching only saves a few minutes and seems brittle.
This commit is contained in:
Holger Rapp 2018-04-09 15:05:40 +02:00 committed by UltiBot
parent 411d0118ef
commit 01c4bde123
4 changed files with 10 additions and 63 deletions

View File

@ -1,29 +1,19 @@
sudo: required sudo: required
services: docker 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: env:
matrix: - VIM_VERSION="7.4" PYTHON_IMAGE=2.7-stretch TAG=vim_74_py2
- 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
- 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
- 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
- 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
- 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
- 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
install: 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: script:
- docker run -it ultisnips:${TAG} docker/run_tests.sh - docker run -it ultisnips:${TAG} docker/run_tests.sh
- docker/save_docker_cache.sh
notifications: notifications:
webhooks: webhooks:

View File

@ -3,7 +3,6 @@ ARG PYTHON_IMAGE
FROM python:${PYTHON_IMAGE} FROM python:${PYTHON_IMAGE}
ARG VIM_VERSION ARG VIM_VERSION
ARG GITHUB_ACCESS_TOKEN
COPY docker/install_packages.sh src/scripts/ COPY docker/install_packages.sh src/scripts/
RUN src/scripts/install_packages.sh RUN src/scripts/install_packages.sh
@ -12,26 +11,9 @@ RUN src/scripts/download_vim.sh
COPY docker/build_vim.sh src/scripts/ COPY docker/build_vim.sh src/scripts/
RUN src/scripts/build_vim.sh 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 RUN pip install unidecode
COPY . /src/UltiSnips COPY . /src/UltiSnips
WORKDIR /src/UltiSnips WORKDIR /src/UltiSnips
RUN ./test_all.py --clone-plugins

View File

@ -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

View File

@ -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 '<missing>')
docker save ${IMAGE_NAMES} | gzip > ${DOCKER_CACHE_FILE}.new
mv ${DOCKER_CACHE_FILE}.new ${DOCKER_CACHE_FILE}
fi