Initial version
Some checks failed
continuous-integration/drone Build is passing
continuous-integration/drone/tag Build is failing

This commit is contained in:
Julien Valverdé
2023-08-31 02:16:43 +02:00
parent 416a133d82
commit cfd90744bc
18 changed files with 477 additions and 0 deletions

71
.drone.jsonnet Normal file
View File

@@ -0,0 +1,71 @@
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 --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),
],
},
]