refactor(build): updated .drone
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -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),
|
||||
])
|
||||
}
|
||||
@@ -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,
|
||||
])
|
||||
|
||||
}
|
||||
15
.drone/libs/steps/buildPushContainerImage.jsonnet
Normal file
15
.drone/libs/steps/buildPushContainerImage.jsonnet
Normal 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 []
|
||||
|
||||
)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user