diff --git a/.drone.yml b/.drone.yml index 930ac59..8c3a28d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,35 +3,42 @@ 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: 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.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' cython numpy==1.18.2 + - 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 - image: drillster/drone-volume-cache - volumes: - - name: cache - path: /cache - settings: - rebuild: true - mount: - - /root/.cache/pip + - 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' - name: kaniko image: banzaicloud/drone-kaniko @@ -56,5 +63,4 @@ steps: volumes: - name: cache - host: - path: /tmp/cache + temp: {} diff --git a/Dockerfile b/Dockerfile index bd88bcb..bfc818c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,6 @@ ENV PIP_NO_CACHE_DIR=true ENV TZ Europe/Budapest RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone -RUN pip3 install -r requirements.txt +RUN pip3 install cython numpy==1.18.2 && pip3 install -r requirements.txt ENTRYPOINT ["python3","main.py"]