Add yarn cache to drone (#312)

Fix cache configuration for releases

Change cache bucket

Change dependency cache folder

Only start installing dependencies once cache has been restored

Fix configuration for dependency caching

Fix s3 access key & secret

Add yarn cache to drone

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/312
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
This commit is contained in:
konrad 2020-12-06 17:45:44 +00:00
parent 46b7f71000
commit e15d15ed90

View file

@ -11,20 +11,74 @@ trigger:
- pull_request - pull_request
steps: steps:
- name: restore-cache
image: meltwater/drone-cache:dev
pull: true
environment:
AWS_ACCESS_KEY_ID:
from_secret: cache_aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: cache_aws_secret_access_key
settings:
restore: true
bucket: kolaente.dev-drone-dependency-cache
endpoint: https://s3.fr-par.scw.cloud
region: fr-par
path_style: true
mount:
- '.cache'
- name: dependencies
image: node:13
pull: true
group: build-static
environment:
YARN_CACHE_FOLDER: .cache
commands:
- yarn --frozen-lockfile --network-timeout 100000
depends_on:
- restore-cache
- name: rebuild-cache
image: meltwater/drone-cache:dev
pull: true
environment:
AWS_ACCESS_KEY_ID:
from_secret: cache_aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: cache_aws_secret_access_key
settings:
rebuild: true
bucket: kolaente.dev-drone-dependency-cache
endpoint: https://s3.fr-par.scw.cloud
region: fr-par
path_style: true
mount:
- '.cache'
depends_on:
- dependencies
- name: build - name: build
image: node:13 image: node:13
pull: true pull: true
group: build-static group: build-static
environment:
YARN_CACHE_FOLDER: .cache
commands: commands:
- yarn --frozen-lockfile --network-timeout 100000
- yarn run lint - yarn run lint
- yarn run build - yarn run build
depends_on:
- dependencies
- name: test - name: test
image: node:13 image: node:13
pull: true pull: true
group: build-static group: build-static
commands: commands:
- yarn test - yarn test
depends_on:
- dependencies
--- ---
kind: pipeline kind: pipeline
name: release-latest name: release-latest
@ -41,10 +95,29 @@ steps:
commands: commands:
- git fetch --tags - git fetch --tags
- name: restore-cache
image: meltwater/drone-cache:dev
pull: true
environment:
AWS_ACCESS_KEY_ID:
from_secret: cache_aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: cache_aws_secret_access_key
settings:
restore: true
bucket: kolaente.dev-drone-dependency-cache
endpoint: https://s3.fr-par.scw.cloud
region: fr-par
path_style: true
mount:
- '.cache'
- name: build - name: build
image: node:13 image: node:13
pull: true pull: true
group: build-static group: build-static
environment:
YARN_CACHE_FOLDER: .cache
commands: commands:
- yarn --frozen-lockfile --network-timeout 100000 - yarn --frozen-lockfile --network-timeout 100000
- yarn run lint - yarn run lint
@ -91,10 +164,29 @@ steps:
commands: commands:
- git fetch --tags - git fetch --tags
- name: restore-cache
image: meltwater/drone-cache:dev
pull: true
environment:
AWS_ACCESS_KEY_ID:
from_secret: cache_aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: cache_aws_secret_access_key
settings:
restore: true
bucket: kolaente.dev-drone-dependency-cache
endpoint: https://s3.fr-par.scw.cloud
region: fr-par
path_style: true
mount:
- '.cache'
- name: build - name: build
image: node:13 image: node:13
pull: true pull: true
group: build-static group: build-static
environment:
YARN_CACHE_FOLDER: .cache
commands: commands:
- yarn --frozen-lockfile --network-timeout 100000 - yarn --frozen-lockfile --network-timeout 100000
- yarn run lint - yarn run lint