From f97b94a7e15b62f6d5a6b1832e49b2d67c2b3e49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Wed, 6 May 2020 15:11:44 +0200 Subject: [PATCH] cache pip --- .drone.yml | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index f6c28ca..c75ef2f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,16 +3,45 @@ type: docker name: default steps: +- name: restore-cache-with-filesystem + image: meltwater/drone-cache + settings: + backend: "filesystem" + restore: true + cache_key: "{{ .Repo.Name }}" + archive_format: "gzip" + filesystem_cache_root: "/tmp/cache" + mount: + - '.pipcache' + volumes: + - name: cache + path: /tmp/cache + - name: static_analysis - image: "python:3" + image: "python:3.8" commands: - - pip3 install pylint bandit mccabe - - pip3 install -r requirements.txt + - pip3 install --cache-dir='./.pipcache' pylint bandit mccabe + - pip3 install --cache-dir='./.pipcache' -r requirements.txt - find . -name "*.py" -exec python3 -m py_compile '{}' \; - find . -name "*.py" -exec pylint '{}' + || if [ $? -eq 1 ]; then echo "you fail"; fi - find . -name "*.py" -exec python3 -m mccabe --min 3 '{}' + || if [ $? -eq 1 ]; then echo "you fail"; fi - bandit -r . + || if [ $? -eq 1 ]; then echo "you fail"; fi +- name: rebuild-cache-with-filesystem + image: meltwater/drone-cache:dev + pull: true + settings: + backend: "filesystem" + rebuild: true + cache_key: "{{ .Repo.Name }}" + archive_format: "gzip" + filesystem_cache_root: "/tmp/cache" + mount: + - '.pipcache' + volumes: + - name: cache + path: /tmp/cache + - name: kaniko image: banzaicloud/drone-kaniko settings: @@ -33,3 +62,7 @@ steps: from_secret: TEAMS_WEBHOOK when: status: [ failure ] + +volumes: + - name: cache + temp: {}