refactor(build): updated .drone
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -3,7 +3,8 @@ local secret = import '../../drone/secret.jsonnet';
|
||||
local platform = import '../../drone/platform.jsonnet';
|
||||
local baseVerifyBranch = import '../../pipelines/baseVerifyBranch.jsonnet';
|
||||
local baseVerifyMain = import '../../pipelines/baseVerifyMain.jsonnet';
|
||||
local publishContainer = import '../../pipelines/publishContainer.jsonnet';
|
||||
local buildContainer = import '../../pipelines/FHQ/buildContainer.jsonnet';
|
||||
local buildMultiArch = import '../../pipelines/FHQ/buildMultiArchContainer.jsonnet';
|
||||
|
||||
local dockerSecret = secret.new(name="GITLAB_TOKEN", path="gitlab", key="token");
|
||||
|
||||
@@ -17,12 +18,13 @@ local amd64 = platform.new("linux","amd64");
|
||||
.withPipelines([
|
||||
baseVerifyBranch.new(),
|
||||
baseVerifyMain.new(),
|
||||
publishContainer.new(name,"0.0.1-amd64", ".", "registry.cloud.federationhq.de")
|
||||
buildContainer.new(name,"0.0.1-amd64", ".", "registry.cloud.federationhq.de")
|
||||
.withPlatform(amd64)
|
||||
.withName("Build " + name + " on amd64"),
|
||||
publishContainer.new(name,"0.0.1-arm64", ".", "registry.cloud.federationhq.de")
|
||||
.withName("Build-on-amd64"),
|
||||
buildContainer.new(name,"0.0.1-arm64", ".", "registry.cloud.federationhq.de")
|
||||
.withPlatform(arm64)
|
||||
.withName("Build " + name + " on arm64")
|
||||
.withName("Build-on-arm64"),
|
||||
buildMultiArch.new(name,"0.0.1").withDependsOn(["Build-on-amd64","Build-on-arm64"])
|
||||
])
|
||||
|
||||
|
||||
|
||||
11
.drone/libs/pipelines/FHQ/buildContainer.jsonnet
Normal file
11
.drone/libs/pipelines/FHQ/buildContainer.jsonnet
Normal file
@@ -0,0 +1,11 @@
|
||||
local pipeline = import '../../drone/pipeline.jsonnet';
|
||||
local build = import '../../steps/buildContainerImage.jsonnet';
|
||||
local gitSteps = import '../../steps/git.jsonnet';
|
||||
{
|
||||
new(name,tag,dir,registry):: pipeline.new()
|
||||
.withName("Publish Container")
|
||||
.withSteps([
|
||||
gitSteps.checkoutSubmodules().withName("CheckoutSubmodules"),
|
||||
build.new(name, tag, dir, registry)
|
||||
])
|
||||
}
|
||||
11
.drone/libs/pipelines/FHQ/buildMultiArchContainer.jsonnet
Normal file
11
.drone/libs/pipelines/FHQ/buildMultiArchContainer.jsonnet
Normal file
@@ -0,0 +1,11 @@
|
||||
local pipeline = import '../../drone/pipeline.jsonnet';
|
||||
local build = import '../../steps/buildMultiArchContainerImage.jsonnet';
|
||||
local gitSteps = import '../../steps/git.jsonnet';
|
||||
{
|
||||
new(name,tag):: pipeline.new()
|
||||
.withName("MulitArchPipeline")
|
||||
.withSteps([
|
||||
gitSteps.checkoutSubmodules().withName("CheckoutSubmodules"),
|
||||
build.new(name, tag)
|
||||
])
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
local pipeline = import '../drone/pipeline.jsonnet';
|
||||
local publish = import '../steps/buildContainerImage.jsonnet';
|
||||
local gitSteps = import '../steps/git.jsonnet';
|
||||
{
|
||||
new(name,tag,dir,registry):: pipeline.new()
|
||||
.withName("Publish Container")
|
||||
.withSteps([
|
||||
gitSteps.checkoutSubmodules().withName("CheckoutSubmodules"),
|
||||
publish.new(name, tag, dir, registry)
|
||||
])
|
||||
}
|
||||
13
.drone/libs/steps/buildMultiArchContainerImage.jsonnet
Normal file
13
.drone/libs/steps/buildMultiArchContainerImage.jsonnet
Normal file
@@ -0,0 +1,13 @@
|
||||
local step = import '../drone/step.jsonnet';
|
||||
|
||||
{
|
||||
new(name,tag):: step.new("Build MultiArch Container Image", "quay.io/buildah/stable")
|
||||
.withPrivileged()
|
||||
.withCommands([
|
||||
"buildah manifest create " + name + ":" + tag,
|
||||
"buildah manifest add " + name + ":" + tag + " registry.cloud.federationhq.de/" + name + ":" + tag + "-amd64",
|
||||
"buildah manifest add " + name + ":" + tag + " registry.cloud.federationhq.de/" + name + ":" + tag + "-arm64",
|
||||
"buildah manifest push --all " + name + ":" + tag + "docker://registry.cloud.federationhq.de/" + name + ":" + tag
|
||||
])
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user