refactor(build): updated .drone
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-12-18 08:30:55 +01:00
parent 909b40d361
commit bfa06e91b4
3 changed files with 17 additions and 14 deletions

View File

@@ -1,11 +1,9 @@
local pipeline = import '../drone/pipeline.jsonnet';
local build = import '../steps/buildContainerImage.jsonnet';
local push = import '../steps/pushContainerImage.jsonnet';
local build = import '../steps/buildPushContainerImage.jsonnet';
{
new(registry,name,tag,dir):: pipeline.new()
.withName("Build-Push-Container")
.withSteps([
build.new(registry,name,tag,dir),
push.new(registry,name,tag)
build.new(registry,name,tag,dir,true),
])
}

View File

@@ -1,10 +0,0 @@
local step = import '../drone/step.jsonnet';
{
new(registry,name,tag,dir):: step.new("Build and Push Container Image", "quay.io/buildah/stable")
.withPrivileged()
.withCommands([
"cd " + dir + ";" + "buildah bud -t " + registry.hostname + "/" + name + ":" + tag,
])
}

View File

@@ -0,0 +1,15 @@
local step = import '../drone/step.jsonnet';
{
new(registry,name,tag,dir,push=false):: step.new("Build and Push Container Image", "quay.io/buildah/stable")
.withPrivileged()
.withCommands([
"cd " + dir + ";" + "buildah bud -t " + registry.hostname + "/" + name + ":" + tag,
] +
if push then [
"buildah push --all " + registry.hostname + "/" + name + ":" + tag + " docker://" + registry.hostname + "/" + name + ":" + tag
] else []
)
}