Files
drone-better-docker-autotag/.drone.jsonnet
Julien Valverdé 1c482610f4
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
Attempt to fix git fetch certificate error
2023-08-31 03:03:29 +02:00

72 lines
1.7 KiB
Jsonnet

local bun_image = "oven/bun:0.8.1";
local install_run_step = {
name: "install-run",
image: bun_image,
commands: [
"apt update -y && apt full-upgrade -y && apt install -y --reinstall ca-certificates && apt install -y --no-install-recommends git",
"bun install --production --frozen-lockfile --no-cache",
"bun start .",
],
};
local build_docker_step(publish) = {
name: "build-" + (if publish then "publish-" else "") + "docker",
image: "plugins/docker",
settings: {
dry_run: !publish,
registry: "git.jvalver.de",
username: { from_secret: "docker_username" },
password: { from_secret: "docker_password" },
repo: "git.jvalver.de/thilawyn/drone-better-docker-autotag",
dockerfile: "Dockerfile",
context: ".",
compress: true,
platform: "linux/amd64",
},
};
[
// Build docker images without publishing them for pull requests
{
kind: "pipeline",
type: "docker",
name: "build-docker",
trigger: {
ref: {
include: ["refs/pull/**"]
}
},
steps: [
install_run_step,
build_docker_step(false),
],
},
// Build docker images and publish them for master and tags
{
kind: "pipeline",
type: "docker",
name: "build-publish-docker",
trigger: {
ref: {
include: [
"refs/heads/master",
"refs/tags/**",
]
}
},
steps: [
install_run_step,
build_docker_step(true),
],
},
]