feature/improve-drone-config #2637

Merged
konrad merged 5 commits from dpschen/frontend:feature/improve-drone-config into main 2022-11-08 14:56:46 +00:00
1 changed files with 30 additions and 28 deletions

View File

@ -1,5 +1,6 @@
--- ---
kind: pipeline kind: pipeline
type: docker
dpschen marked this conversation as resolved Outdated

Is docker the default? I was unsure here, but my drone linter in vscode told me that not declaring a type is also wrong.

Is `docker` the default? I was unsure here, but my drone linter in vscode told me that not declaring a type is also wrong.

Docker is the default, yes.

Docker is the default, yes.
name: build name: build
trigger: trigger:
@ -22,7 +23,7 @@ steps:
# Disabled until we figure out why it is so slow # Disabled until we figure out why it is so slow
# - name: restore-cache # - name: restore-cache
# image: meltwater/drone-cache:dev # image: meltwater/drone-cache:dev
# pull: true # pull: always
# environment: # environment:
# AWS_ACCESS_KEY_ID: # AWS_ACCESS_KEY_ID:
# from_secret: cache_aws_access_key_id # from_secret: cache_aws_access_key_id
@ -41,7 +42,7 @@ steps:
- name: dependencies - name: dependencies
image: node:18-alpine image: node:18-alpine
pull: true pull: always

I forgot (and couldn't find out) if always is the default value either way. If so we could also remove the pull property.

I forgot (and couldn't find out) if `always` is the default value either way. If so we could also remove the `pull` property.

Do you know where to find the default config of drone?

Do you know where to find the default config of drone?

There's a reference somewhere.

I think for this particular case this is the relevant part of the docs: https://docs.drone.io/pipeline/kubernetes/syntax/images/#pulling-images

There's a reference somewhere. I think for this particular case this is the relevant part of the docs: https://docs.drone.io/pipeline/kubernetes/syntax/images/#pulling-images

Yes, sadly they don't mention the default setting.

Yes, sadly they don't mention the default setting.

But they say:

If the image is tagged with latest, Drone will always attempt to pull the latest version of the image. Configure the runner to only pull the image if not found in the local cache:

But they say: > If the image is tagged with latest, Drone will always attempt to pull the latest version of the image. Configure the runner to only pull the image if not found in the local cache:

Ahh, and ours are tagged with latest, so it will pull the latest anyway?

Ahh, and ours are tagged with latest, so it will pull the latest anyway?

This particular one has a tag of 18-alpine so it won't pull it always.

This particular one has a tag of `18-alpine` so it won't pull it always.
environment: environment:
PNPM_CACHE_FOLDER: .cache/pnpm PNPM_CACHE_FOLDER: .cache/pnpm
CYPRESS_CACHE_FOLDER: .cache/cypress CYPRESS_CACHE_FOLDER: .cache/cypress
@ -53,7 +54,7 @@ steps:
- name: lint - name: lint
image: node:18-alpine image: node:18-alpine
pull: true pull: always
environment: environment:
PNPM_CACHE_FOLDER: .cache/pnpm PNPM_CACHE_FOLDER: .cache/pnpm
commands: commands:
@ -64,7 +65,7 @@ steps:
- name: build-prod - name: build-prod
image: node:18-alpine image: node:18-alpine
pull: true pull: always
environment: environment:
PNPM_CACHE_FOLDER: .cache/pnpm PNPM_CACHE_FOLDER: .cache/pnpm
commands: commands:
@ -75,7 +76,7 @@ steps:
- name: test-unit - name: test-unit
image: node:18-alpine image: node:18-alpine
pull: true pull: always
commands: commands:
- corepack enable && pnpm config set store-dir .cache/pnpm - corepack enable && pnpm config set store-dir .cache/pnpm
- pnpm run test:unit - pnpm run test:unit
@ -85,7 +86,7 @@ steps:
- name: typecheck - name: typecheck
failure: ignore failure: ignore
image: node:18-alpine image: node:18-alpine
pull: true pull: always
environment: environment:
PNPM_CACHE_FOLDER: .cache/pnpm PNPM_CACHE_FOLDER: .cache/pnpm
commands: commands:
@ -95,8 +96,8 @@ steps:
- dependencies - dependencies
- name: test-frontend - name: test-frontend
image: cypress/browsers:node16.14.0-chrome99-ff97 image: cypress/browsers:node18.12.0-chrome106-ff106
pull: true pull: always
environment: environment:
CYPRESS_API_URL: http://api:3456/api/v1 CYPRESS_API_URL: http://api:3456/api/v1
CYPRESS_TEST_SECRET: averyLongSecretToSe33dtheDB CYPRESS_TEST_SECRET: averyLongSecretToSe33dtheDB
@ -116,7 +117,7 @@ steps:
# - name: rebuild-cache # - name: rebuild-cache
# image: meltwater/drone-cache:dev # image: meltwater/drone-cache:dev
# pull: true # pull: always
# environment: # environment:
# AWS_ACCESS_KEY_ID: # AWS_ACCESS_KEY_ID:
# from_secret: cache_aws_access_key_id # from_secret: cache_aws_access_key_id
@ -136,7 +137,7 @@ steps:
- name: deploy-preview - name: deploy-preview
image: node:18-alpine image: node:18-alpine
pull: true pull: always
environment: environment:
NETLIFY_AUTH_TOKEN: NETLIFY_AUTH_TOKEN:
from_secret: netlify_auth_token from_secret: netlify_auth_token
@ -160,6 +161,7 @@ steps:
--- ---
kind: pipeline kind: pipeline
type: docker
name: release-latest name: release-latest
depends_on: depends_on:
@ -179,7 +181,7 @@ steps:
# - name: restore-cache # - name: restore-cache
# image: meltwater/drone-cache:dev # image: meltwater/drone-cache:dev
# pull: true # pull: always
# environment: # environment:
# AWS_ACCESS_KEY_ID: # AWS_ACCESS_KEY_ID:
# from_secret: cache_aws_access_key_id # from_secret: cache_aws_access_key_id
@ -197,13 +199,12 @@ steps:
- name: build - name: build
image: node:18-alpine image: node:18-alpine
pull: true pull: always
group: build-static
dpschen marked this conversation as resolved Outdated

A group property doesn't seem to exist in drone.

A `group` property doesn't seem to exist in drone.

That's probably a relic from Drone 1

That's probably a relic from Drone 1
environment: environment:
PNPM_CACHE_FOLDER: .cache/pnpm PNPM_CACHE_FOLDER: .cache/pnpm
commands: commands:
- apk add git - apk add git
- corepack enable && pnpm config set store-dir .cache/.pnp - corepack enable && pnpm config set store-dir .cache/.pnpm
dpschen marked this conversation as resolved Outdated

This cache folder was wrong. Maybe this decreases our build time?

This cache folder was wrong. Maybe this decreases our build time?
- pnpm install --fetch-timeout 100000 --frozen-lockfile - pnpm install --fetch-timeout 100000 --frozen-lockfile
- pnpm run lint - pnpm run lint
- "echo '{\"VERSION\": \"'$(git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')'\"}' > src/version.json" - "echo '{\"VERSION\": \"'$(git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')'\"}' > src/version.json"
@ -214,7 +215,7 @@ steps:
- name: static - name: static
image: kolaente/zip image: kolaente/zip
pull: true pull: always
commands: commands:
- cd dist - cd dist
- zip -r ../vikunja-frontend-unstable.zip * - zip -r ../vikunja-frontend-unstable.zip *
@ -223,7 +224,7 @@ steps:
- name: release - name: release
image: plugins/s3 image: plugins/s3
pull: true pull: always
settings: settings:
bucket: vikunja-releases bucket: vikunja-releases
access_key: access_key:
@ -239,6 +240,7 @@ steps:
--- ---
kind: pipeline kind: pipeline
type: docker
name: release-version name: release-version
depends_on: depends_on:
@ -256,7 +258,7 @@ steps:
# - name: restore-cache # - name: restore-cache
# image: meltwater/drone-cache:dev # image: meltwater/drone-cache:dev
# pull: true # pull: always
# environment: # environment:
# AWS_ACCESS_KEY_ID: # AWS_ACCESS_KEY_ID:
# from_secret: cache_aws_access_key_id # from_secret: cache_aws_access_key_id
@ -274,8 +276,7 @@ steps:
- name: build - name: build
image: node:18-alpine image: node:18-alpine
pull: true pull: always
group: build-static
environment: environment:
PNPM_CACHE_FOLDER: .cache/pnpm PNPM_CACHE_FOLDER: .cache/pnpm
commands: commands:
@ -291,7 +292,7 @@ steps:
- name: static - name: static
image: kolaente/zip image: kolaente/zip
pull: true pull: always
commands: commands:
- cd dist - cd dist
- zip -r ../vikunja-frontend-${DRONE_TAG##v}.zip * - zip -r ../vikunja-frontend-${DRONE_TAG##v}.zip *
@ -300,7 +301,7 @@ steps:
- name: release - name: release
image: plugins/s3 image: plugins/s3
pull: true pull: always
settings: settings:
bucket: vikunja-releases bucket: vikunja-releases
access_key: access_key:
@ -316,6 +317,7 @@ steps:
--- ---
kind: pipeline kind: pipeline
type: docker
name: trigger-desktop-update name: trigger-desktop-update
trigger: trigger:
@ -361,7 +363,7 @@ trigger:
steps: steps:
- name: docker-unstable - name: docker-unstable
image: plugins/docker:linux-arm image: plugins/docker:linux-arm
pull: true pull: always
settings: settings:
username: username:
from_secret: docker_username from_secret: docker_username
@ -380,7 +382,7 @@ steps:
- name: docker-version - name: docker-version
image: plugins/docker:linux-arm image: plugins/docker:linux-arm
pull: true pull: always
settings: settings:
username: username:
from_secret: docker_username from_secret: docker_username
@ -400,7 +402,7 @@ steps:
- name: docker-unstable-arm64 - name: docker-unstable-arm64
image: plugins/docker:linux-arm64 image: plugins/docker:linux-arm64
pull: true pull: always
settings: settings:
username: username:
from_secret: docker_username from_secret: docker_username
@ -419,7 +421,7 @@ steps:
- name: docker-version-arm64 - name: docker-version-arm64
image: plugins/docker:linux-arm64 image: plugins/docker:linux-arm64
pull: true pull: always
settings: settings:
username: username:
from_secret: docker_username from_secret: docker_username
@ -461,7 +463,7 @@ trigger:
steps: steps:
- name: docker-unstable - name: docker-unstable
image: plugins/docker:linux-amd64 image: plugins/docker:linux-amd64
pull: true pull: always
settings: settings:
username: username:
from_secret: docker_username from_secret: docker_username
@ -478,7 +480,7 @@ steps:
- name: docker-version - name: docker-version
image: plugins/docker:linux-amd64 image: plugins/docker:linux-amd64
pull: true pull: always
settings: settings:
username: username:
from_secret: docker_username from_secret: docker_username
@ -661,6 +663,6 @@ steps:
from_secret: crowdin_key from_secret: crowdin_key
--- ---
kind: signature kind: signature
hmac: 5dc7ab785b6e4d1611fc2851971e23c444d93d4988517f116e02e8c4d1af82f3 hmac: 6784e836f6568c67abfb909449c6e845cc73cbe9a31e9e7ad9166a0eb59e30a2
... ...