From ffd8dfed1647bcbd2ae7dbf970d36bf337af15fa Mon Sep 17 00:00:00 2001 From: Tuan Anh Tran Date: Tue, 8 Oct 2024 08:27:19 +0700 Subject: [PATCH] kargo: bundle ui within binary (#29781) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This one basically move the build UI step above go/build since kargo now bundles its UI component within the binary itself so `ui/build` folder has to be there before go/build Not sure how to add tests for this? Maybe we can do it in images project? Fixes: https://github.com/wolfi-dev/os/issues/29695 Related: ### Pre-review Checklist #### For new package PRs only - [ ] This PR is marked as fixing a pre-existing package request bug - [ ] Alternatively, the PR is marked as related to a pre-existing package request bug, such as a dependency - [ ] REQUIRED - The package is available under an OSI-approved or FSF-approved license - [ ] REQUIRED - The version of the package is still receiving security updates - [ ] This PR links to the upstream project's support policy (e.g. `endoflife.date`) #### For new version streams - [ ] The upstream project actually supports multiple concurrent versions. - [ ] Any subpackages include the version string in their package name (e.g. `name: ${{package.name}}-compat`) - [ ] The package (and subpackages) `provides:` logical unversioned forms of the package (e.g. `nodejs`, `nodejs-lts`) - [ ] If non-streamed package names no longer built, open PR to withdraw them (see [WITHDRAWING PACKAGES](https://github.com/wolfi-dev/os/blob/main/WITHDRAWING_PACKAGES.md)) #### For package updates (renames) in the base images When updating packages part of base images (i.e. cgr.dev/chainguard/wolfi-base or ghcr.io/wolfi-dev/sdk) - [ ] REQUIRED cgr.dev/chainguard/wolfi-base and ghcr.io/wolfi-dev/sdk images successfully build - [ ] REQUIRED cgr.dev/chainguard/wolfi-base and ghcr.io/wolfi-dev/sdk contain no obsolete (no longer built) packages - [ ] Upon launch, does `apk upgrade --latest` successfully upgrades packages or performs no actions #### For security-related PRs - [ ] The security fix is recorded in the [advisories](https://github.com/wolfi-dev/advisories) repo #### For version bump PRs - [ ] The `epoch` field is reset to 0 #### For PRs that add patches - [ ] Patch source is documented --------- Signed-off-by: Tuan Anh Tran --- kargo.yaml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/kargo.yaml b/kargo.yaml index a381ee07a8b..5afb666d0a4 100644 --- a/kargo.yaml +++ b/kargo.yaml @@ -26,21 +26,16 @@ pipeline: tag: v${{package.version}} expected-commit: f28891365762f3183b4d720fde99753ed7471e1d - - uses: go/build - with: - packages: ./cmd/controlplane - output: kargo - ldflags: "-w -s -X github.com/akuity/kargo/internal/version.version=${{package.version}} -X github.com/akuity/kargo/internal/version.gitCommit=$(git rev-parse HEAD)" - - runs: | - export COREPACK_ENABLE_STRICT=0 cd ui pnpm install NODE_ENV='production' pnpm run build - mkdir -p ${{targets.destdir}}/usr/share/kargo/ui - - mv build ${{targets.destdir}}/usr/share/kargo/ui + - uses: go/build + with: + packages: ./cmd/controlplane + output: kargo + ldflags: "-w -s -X github.com/akuity/kargo/internal/version.version=${{package.version}} -X github.com/akuity/kargo/internal/version.gitCommit=$(git rev-parse HEAD)" - uses: strip @@ -55,7 +50,6 @@ subpackages: - runs: | mkdir -p ${{targets.subpkgdir}}/usr/local/bin ln -sf /usr/bin/kargo ${{targets.subpkgdir}}/usr/local/bin/kargo - ln -sf /usr/share/kargo/ui ${{targets.subpkgdir}}/ ln -sf /usr/bin/grpc-health-probe ${{targets.subpkgdir}}/usr/local/bin/grpc_health_probe test: pipeline: