From 2770e0921de41196caa763258c98121d0d283103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Wed, 6 May 2020 12:52:24 +0200 Subject: [PATCH] use volume cache --- .drone.yml | 27 ++++++++++++++++++++++++++- Dockerfile | 2 +- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index f6c28ca..930ac59 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,8 +3,18 @@ type: docker name: default steps: +- name: restore-cache + image: drillster/drone-volume-cache + volumes: + - name: cache + path: /cache + settings: + restore: true + mount: + - /root/.cache/pip + - name: static_analysis - image: "python:3" + image: "python:3.8" commands: - pip3 install pylint bandit mccabe - pip3 install -r requirements.txt @@ -13,6 +23,16 @@ steps: - 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 + image: drillster/drone-volume-cache + volumes: + - name: cache + path: /cache + settings: + rebuild: true + mount: + - /root/.cache/pip + - name: kaniko image: banzaicloud/drone-kaniko settings: @@ -33,3 +53,8 @@ steps: from_secret: TEAMS_WEBHOOK when: status: [ failure ] + +volumes: + - name: cache + host: + path: /tmp/cache diff --git a/Dockerfile b/Dockerfile index 6e83219..bd88bcb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.8 +FROM registry.kmlabz.com/birbnetes/ai-base-image ADD extractor_service requirements.txt /extractor_service/ WORKDIR /extractor_service/