use different caching method
This commit is contained in:
		
							
								
								
									
										50
									
								
								.drone.yml
									
									
									
									
									
								
							
							
						
						
									
										50
									
								
								.drone.yml
									
									
									
									
									
								
							@@ -3,35 +3,42 @@ type: docker
 | 
				
			|||||||
name: default
 | 
					name: default
 | 
				
			||||||
 | 
					
 | 
				
			||||||
steps:
 | 
					steps:
 | 
				
			||||||
- name: restore-cache
 | 
					  - name: restore-cache-with-filesystem
 | 
				
			||||||
  image: drillster/drone-volume-cache
 | 
					    image: meltwater/drone-cache
 | 
				
			||||||
  volumes:
 | 
					    settings:
 | 
				
			||||||
  - name: cache
 | 
					      backend: "filesystem"
 | 
				
			||||||
    path: /cache
 | 
					      restore: true
 | 
				
			||||||
  settings:
 | 
					      cache_key: "{{ .Repo.Name }}"
 | 
				
			||||||
    restore: true
 | 
					      archive_format: "gzip"
 | 
				
			||||||
    mount:
 | 
					      filesystem_cache_root: "/tmp/cache"
 | 
				
			||||||
      - /root/.cache/pip
 | 
					      mount:
 | 
				
			||||||
 | 
					        - '.pipcache'
 | 
				
			||||||
 | 
					    volumes:
 | 
				
			||||||
 | 
					    - name: cache
 | 
				
			||||||
 | 
					      path: /tmp/cache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: static_analysis
 | 
					- name: static_analysis
 | 
				
			||||||
  image: "python:3.8"
 | 
					  image: "python:3.8"
 | 
				
			||||||
  commands:
 | 
					  commands:
 | 
				
			||||||
  - pip3 install pylint bandit mccabe
 | 
					  - pip3 install --cache-dir='./.pipcache' pylint bandit mccabe
 | 
				
			||||||
  - pip3 install -r requirements.txt
 | 
					  - 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 python3 -m py_compile '{}' \;
 | 
				
			||||||
  - find . -name "*.py" -exec pylint '{}' + || if [ $? -eq 1 ]; then echo "you fail"; fi
 | 
					  - 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
 | 
					  - 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
 | 
					  - bandit -r . + || if [ $? -eq 1 ]; then echo "you fail"; fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: rebuild-cache
 | 
					  - name: rebuild-cache-with-filesystem
 | 
				
			||||||
  image: drillster/drone-volume-cache
 | 
					    image: meltwater/drone-cache:dev
 | 
				
			||||||
  volumes:
 | 
					    pull: true
 | 
				
			||||||
  - name: cache
 | 
					    settings:
 | 
				
			||||||
    path: /cache
 | 
					      backend: "filesystem"
 | 
				
			||||||
  settings:
 | 
					      rebuild: true
 | 
				
			||||||
    rebuild: true
 | 
					      cache_key: "{{ .Repo.Name }}"
 | 
				
			||||||
    mount:
 | 
					      archive_format: "gzip"
 | 
				
			||||||
      - /root/.cache/pip
 | 
					      filesystem_cache_root: "/tmp/cache"
 | 
				
			||||||
 | 
					      mount:
 | 
				
			||||||
 | 
					        - '.pipcache'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: kaniko
 | 
					- name: kaniko
 | 
				
			||||||
  image: banzaicloud/drone-kaniko
 | 
					  image: banzaicloud/drone-kaniko
 | 
				
			||||||
@@ -56,5 +63,4 @@ steps:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
volumes:
 | 
					volumes:
 | 
				
			||||||
  - name: cache
 | 
					  - name: cache
 | 
				
			||||||
    host: 
 | 
					    temp: {}
 | 
				
			||||||
      path: /tmp/cache
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,6 +7,6 @@ ENV PIP_NO_CACHE_DIR=true
 | 
				
			|||||||
ENV TZ Europe/Budapest
 | 
					ENV TZ Europe/Budapest
 | 
				
			||||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
 | 
					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"]
 | 
					ENTRYPOINT ["python3","main.py"]
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user