Skip to content

Commit f3a60a9

Browse files
Kbayeroclaude
andcommitted
fix(ci): repair v12 deploy pipeline (Go backend, collectors, enterprise artifacts)
The PR squash-merged into release/v12.0.0 carried the clobbered v11-architecture pipeline (Maven/Java backend, user-auditor & web-pdf services, utmstack-collector path, config/modules-config plugins; reusable-golang stripped of build_context/ dockerfile inputs). This restores the correct v12 build graph: - backend builds via reusable-golang.yml (Go, context=repo root, backend/Dockerfile) - drop user-auditor & web-pdf - collectors/{utmstack,as400,forwarder} - event processor builds the 16 Go plugins of event_processor.Dockerfile - enterprise artifacts (entitlements, as400-collector.jar, utmstack-collector-mac) via private UTMStackEnterprise releases (ENTERPRISE_ARTIFACTS_VERSION_*) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent f92a4d9 commit f3a60a9

2 files changed

Lines changed: 171 additions & 93 deletions

File tree

.github/workflows/reusable-golang.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,26 @@ on:
1212
flags:
1313
required: false
1414
type: string
15+
build_context:
16+
required: false
17+
type: string
18+
default: ""
19+
description: "Docker build context (defaults to ./<image_name>)"
20+
dockerfile:
21+
required: false
22+
type: string
23+
default: ""
24+
description: "Path to the Dockerfile (defaults to ./<image_name>/Dockerfile)"
25+
secrets:
26+
API_SECRET:
27+
required: false
28+
description: "Token to fetch private github.com/utmstack Go modules. Optional; when unset, only public modules are fetchable (backwards-compatible)."
29+
CM_SIGN_PUBLIC_KEY:
30+
required: false
31+
description: "Optional value baked into the binary via ldflags. The `secrets` context is not allowed in a caller's `with:`, so secret-derived ldflags must be passed here and referenced from `inputs.flags` as $CM_SIGN_PUBLIC_KEY."
32+
CM_ENCRYPT_SALT:
33+
required: false
34+
description: "Optional value baked into the binary via ldflags. Reference from `inputs.flags` as $CM_ENCRYPT_SALT."
1535
jobs:
1636
build:
1737
name: Build
@@ -26,12 +46,27 @@ jobs:
2646
go-version: ^1.20
2747
id: go
2848

49+
- name: Configure git for private modules
50+
run: |
51+
if [ -n "${{ secrets.API_SECRET }}" ]; then
52+
git config --global url."https://${{ secrets.API_SECRET }}:x-oauth-basic@github.com/".insteadOf "https://github.com/"
53+
echo "GOPRIVATE=github.com/utmstack" >> $GITHUB_ENV
54+
echo "GONOPROXY=github.com/utmstack" >> $GITHUB_ENV
55+
echo "GONOSUMDB=github.com/utmstack" >> $GITHUB_ENV
56+
fi
57+
2958
- name: Running Tests
3059
working-directory: ./${{inputs.image_name}}
3160
run: go test -v ./...
3261

3362
- name: Build Binary
3463
working-directory: ./${{inputs.image_name}}
64+
env:
65+
# Exposed so `inputs.flags` can reference them with shell expansion
66+
# ($CM_SIGN_PUBLIC_KEY / $CM_ENCRYPT_SALT). The `secrets` context can't
67+
# be used in the caller's `with:`, only in a step like this one.
68+
CM_SIGN_PUBLIC_KEY: ${{ secrets.CM_SIGN_PUBLIC_KEY }}
69+
CM_ENCRYPT_SALT: ${{ secrets.CM_ENCRYPT_SALT }}
3570
run: |
3671
if [ -n "${{inputs.flags}}" ]; then
3772
go build -o ${{inputs.image_name}} -v -ldflags "${{inputs.flags}}" .
@@ -49,6 +84,7 @@ jobs:
4984
- name: Build and Push the Image
5085
uses: docker/build-push-action@v6
5186
with:
52-
context: ./${{inputs.image_name}}
87+
context: ${{ inputs.build_context != '' && inputs.build_context || format('./{0}', inputs.image_name) }}
88+
file: ${{ inputs.dockerfile != '' && inputs.dockerfile || format('./{0}/Dockerfile', inputs.image_name) }}
5389
push: true
5490
tags: ghcr.io/utmstack/utmstack/${{inputs.image_name}}:${{inputs.tag}}

0 commit comments

Comments
 (0)