Skip to content

Commit

Permalink
[ci] Add option to build other editions with a comment
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Portnov <[email protected]>
  • Loading branch information
Taior committed Sep 6, 2024
1 parent 002190e commit f88995e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
10 changes: 9 additions & 1 deletion .github/scripts/js/ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -760,9 +760,17 @@ const detectSlashCommand = ({ comment , context, core}) => {
}
}

const isBuild = command === '/build';
// Detect /build/* commands.
const isBuild = command.startsWith('/build');
if (isBuild) {
workflow_id = 'build-and-test_release.yml';
// Extract editions if command consists of 2 parts: /build/ce,ee release-1.64
const cmdParts = command.split('/');
if (cmdParts[2]) {
inputs = {
editions: cmdParts[2],
}
}
}

if (workflow_id === '') {
Expand Down
8 changes: 4 additions & 4 deletions .github/workflow_templates/build-and-test_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
- git_info
- go_generate
- workflow_render
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.inputs.editions, 'EE') }}
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.inputs.editions, 'ee') }}
env:
WERF_ENV: "EE"
{!{ tmpl.Exec "build_template" (slice $ctx "release") | strings.Indent 4 }!}
Expand All @@ -112,7 +112,7 @@ jobs:
- git_info
- go_generate
- workflow_render
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.inputs.editions, 'SE') }}
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.inputs.editions, 'se') }}
env:
WERF_ENV: "SE"
{!{ tmpl.Exec "build_template" (slice $ctx "release") | strings.Indent 4 }!}
Expand All @@ -125,7 +125,7 @@ jobs:
- git_info
- go_generate
- workflow_render
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.inputs.editions, 'BE') }}
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.inputs.editions, 'be') }}
env:
WERF_ENV: "BE"
{!{ tmpl.Exec "build_template" (slice $ctx "release") | strings.Indent 4 }!}
Expand All @@ -138,7 +138,7 @@ jobs:
- git_info
- go_generate
- workflow_render
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.inputs.editions, 'CE') }}
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.inputs.editions, 'ce') }}
env:
WERF_ENV: "CE"
{!{ tmpl.Exec "build_template" (slice $ctx "release") | strings.Indent 4 }!}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-and-test_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ jobs:
- git_info
- go_generate
- workflow_render
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.inputs.editions, 'EE') }}
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.inputs.editions, 'ee') }}
env:
WERF_ENV: "EE"
# <template: build_template>
Expand Down Expand Up @@ -1007,7 +1007,7 @@ jobs:
- git_info
- go_generate
- workflow_render
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.inputs.editions, 'SE') }}
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.inputs.editions, 'se') }}
env:
WERF_ENV: "SE"
# <template: build_template>
Expand Down Expand Up @@ -1324,7 +1324,7 @@ jobs:
- git_info
- go_generate
- workflow_render
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.inputs.editions, 'BE') }}
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.inputs.editions, 'be') }}
env:
WERF_ENV: "BE"
# <template: build_template>
Expand Down Expand Up @@ -1641,7 +1641,7 @@ jobs:
- git_info
- go_generate
- workflow_render
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.inputs.editions, 'CE') }}
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.inputs.editions, 'ce') }}
env:
WERF_ENV: "CE"
# <template: build_template>
Expand Down

0 comments on commit f88995e

Please sign in to comment.