Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7744,7 +7744,7 @@ steps:
- cd "/go/src/github.com/gravitational/teleport/build.assets/tooling"
- 'go run ./cmd/gh-trigger-workflow -owner ${DRONE_REPO_OWNER} -repo teleport.e
-tag-workflow -workflow promote-teleport-oci-distroless.yml -workflow-ref=${DRONE_TAG}
-input oss-teleport-repo=${DRONE_REPO} -input oss-teleport-ref=${DRONE_TAG} '
-input "release-source-tag=${DRONE_TAG}" '
environment:
GHA_APP_KEY:
from_secret: GITHUB_WORKFLOW_APP_PRIVATE_KEY
Expand Down Expand Up @@ -19038,6 +19038,6 @@ volumes:
temp: {}
---
kind: signature
hmac: 21a11c7790b9e369c34f99e45f3b24df20dcd822bc4beb1c3d27f76bec331298
hmac: d17f0dff7d28b2f0beed2fbef216d59e77ac6ea4ba542f9fdc4ab9f57ecd58d0

...
23 changes: 13 additions & 10 deletions dronegen/gha.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import (
type ghaBuildType struct {
buildType
trigger
pipelineName string
ghaWorkflow string
srcRefVar string
workflowRefVar string
slackOnError bool
dependsOn []string
inputs map[string]string
pipelineName string
ghaWorkflow string
srcRefVar string
workflowRef string
slackOnError bool
dependsOn []string
inputs map[string]string
}

func ghaBuildPipeline(b ghaBuildType) pipeline {
Expand All @@ -43,10 +43,13 @@ func ghaBuildPipeline(b ghaBuildType) pipeline {
cmd.WriteString(`-repo teleport.e `)
cmd.WriteString(`-tag-workflow `)
fmt.Fprintf(&cmd, `-workflow %s `, b.ghaWorkflow)
fmt.Fprintf(&cmd, `-workflow-ref=${%s} `, b.workflowRefVar)
fmt.Fprintf(&cmd, `-workflow-ref=%s `, b.workflowRef)

cmd.WriteString(`-input oss-teleport-repo=${DRONE_REPO} `)
fmt.Fprintf(&cmd, `-input oss-teleport-ref=${%s} `, b.srcRefVar)
// If we don't need to build teleport...
if b.srcRefVar != "" {
cmd.WriteString(`-input oss-teleport-repo=${DRONE_REPO} `)
fmt.Fprintf(&cmd, `-input oss-teleport-ref=${%s} `, b.srcRefVar)
}

for k, v := range b.inputs {
fmt.Fprintf(&cmd, `-input "%s=%s" `, k, v)
Expand Down
14 changes: 8 additions & 6 deletions dronegen/promote.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ func promoteBuildPipelines() []pipeline {
promotePipelines = append(promotePipelines, promoteBuildOsRepoPipelines()...)

ociPipeline := ghaBuildPipeline(ghaBuildType{
buildType: buildType{os: "linux", fips: false},
trigger: triggerPromote,
pipelineName: "promote-teleport-oci-distroless-images",
ghaWorkflow: "promote-teleport-oci-distroless.yml",
srcRefVar: "DRONE_TAG",
workflowRefVar: "DRONE_TAG",
buildType: buildType{os: "linux", fips: false},
trigger: triggerPromote,
pipelineName: "promote-teleport-oci-distroless-images",
ghaWorkflow: "promote-teleport-oci-distroless.yml",
workflowRef: "${DRONE_TAG}",
inputs: map[string]string{
"release-source-tag": "${DRONE_TAG}",
},
})
ociPipeline.Trigger.Target.Include = append(ociPipeline.Trigger.Target.Include, "promote-distroless")

Expand Down
16 changes: 8 additions & 8 deletions dronegen/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ func pushPipelines() []pipeline {
}

ps = append(ps, ghaBuildPipeline(ghaBuildType{
buildType: buildType{os: "linux", arch: "arm64"},
trigger: triggerPush,
pipelineName: "push-build-linux-arm64",
ghaWorkflow: "release-linux-arm64.yml",
slackOnError: true,
srcRefVar: "DRONE_COMMIT",
workflowRefVar: "DRONE_BRANCH",
inputs: map[string]string{"upload-artifacts": "false"},
buildType: buildType{os: "linux", arch: "arm64"},
trigger: triggerPush,
pipelineName: "push-build-linux-arm64",
ghaWorkflow: "release-linux-arm64.yml",
slackOnError: true,
srcRefVar: "DRONE_COMMIT",
workflowRef: "${DRONE_BRANCH}",
inputs: map[string]string{"upload-artifacts": "false"},
}))

// Only amd64 Windows is supported for now.
Expand Down
28 changes: 14 additions & 14 deletions dronegen/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,23 +189,23 @@ func tagPipelines() []pipeline {
}

ps = append(ps, ghaBuildPipeline(ghaBuildType{
buildType: buildType{os: "linux", arch: "arm64", fips: false},
trigger: triggerTag,
pipelineName: "build-linux-arm64",
ghaWorkflow: "release-linux-arm64.yml",
srcRefVar: "DRONE_TAG",
workflowRefVar: "DRONE_TAG",
dependsOn: []string{tagCleanupPipelineName},
inputs: map[string]string{"upload-artifacts": "true"},
buildType: buildType{os: "linux", arch: "arm64", fips: false},
trigger: triggerTag,
pipelineName: "build-linux-arm64",
ghaWorkflow: "release-linux-arm64.yml",
srcRefVar: "DRONE_TAG",
workflowRef: "${DRONE_TAG}",
dependsOn: []string{tagCleanupPipelineName},
inputs: map[string]string{"upload-artifacts": "true"},
}))

ps = append(ps, ghaBuildPipeline(ghaBuildType{
buildType: buildType{os: "linux", fips: false},
trigger: triggerTag,
pipelineName: "build-teleport-oci-distroless-images",
ghaWorkflow: "release-teleport-oci-distroless.yml",
srcRefVar: "DRONE_TAG",
workflowRefVar: "DRONE_TAG",
buildType: buildType{os: "linux", fips: false},
trigger: triggerTag,
pipelineName: "build-teleport-oci-distroless-images",
ghaWorkflow: "release-teleport-oci-distroless.yml",
srcRefVar: "DRONE_TAG",
workflowRef: "${DRONE_TAG}",
dependsOn: []string{
tagCleanupPipelineName,
"build-linux-amd64-deb",
Expand Down