halig/.drone.jsonnet
2022-08-10 21:25:31 +02:00

59 lines
1.5 KiB
Jsonnet
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
kind: 'pipeline',
type: 'docker',
name: 'build',
trigger: {
ref: [
'refs/heads/**',
'refs/tags/v*',
],
},
environment: {
REGISTRY_HOST: 'https://git.roboces.dev',
DESTINATION_PREFIX: 'git.roboces.dev/catalin/halig', //
},
steps: [
{
name: 'build_base',
image: 'gcr.io/kaniko-project/executor:debug',
environment: {
REGISTRY_USERNAME: {
from_secret: 'REGISTRY_USERNAME',
},
REGISTRY_PASSWORD: {
from_secret: 'REGISTRY_PASSWORD',
},
},
commands: [
'set -euo pipefail',
'mkdir -p /kaniko/.docker',
'echo "{\\"auths\\":{\\"$REGISTRY_HOST\\":{\\"username\\":\\"$REGISTRY_USERNAME\\",\\"password\\":\\"$REGISTRY_PASSWORD\\"}}}" > /kaniko/.docker/config.json',
|||
/kaniko/executor \
--cache=true \
--target base \
--context /drone/src \
--dockerfile Dockerfile \
--destination "$DESTINATION_PREFIX:base-$DRONE_COMMIT_SHA"
|||,
|||
/kaniko/executor \
--cache=true \
--target linters \
--context /drone/src \
--dockerfile Dockerfile \
--destination "$DESTINATION_PREFIX:linters-$DRONE_COMMIT_SHA"
|||, //
],
},
{
name: 'lint',
image: '$DESTINATION_PREFIX:linters-$DRONE_COMMIT_SHA',
commands: [
'pre-commit run --all-files --color always',
],
},
],
}