-
Notifications
You must be signed in to change notification settings - Fork 46
fix(vermeer): add Web UI build pipeline #348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7d0c781
4224e2a
8d5a492
2762d28
1beacee
e7f8202
e150a02
bf640de
285f6d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| # contributor license agreements. See the NOTICE file distributed with | ||
| # this work for additional information regarding copyright ownership. | ||
| # The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| # (the "License"); you may not use this file except in compliance with | ||
| # the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
| name: "Vermeer CI" | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| - /^release-.*$/ | ||
| paths: | ||
| - vermeer/** | ||
| - .github/workflows/vermeer-ci.yml | ||
| pull_request: | ||
| paths: | ||
| - vermeer/** | ||
| - .github/workflows/vermeer-ci.yml | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: vermeer | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| vermeer-build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.23' | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
|
|
||
| - name: Cache Go modules | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/go/pkg/mod | ||
| ~/.cache/go-build | ||
| key: ${{ runner.os }}-go-${{ hashFiles('vermeer/go.sum') }} | ||
| restore-keys: ${{ runner.os }}-go- | ||
|
|
||
| - name: Download Go modules | ||
| run: go mod download | ||
|
|
||
| - name: Download UI assets | ||
| run: ./scripts/download_ui_assets.sh | ||
|
|
||
| - name: Generate embedded assets | ||
| run: cd asset && go generate | ||
|
|
||
| - name: Build | ||
| run: CGO_ENABLED=0 go build -o vermeer | ||
|
|
||
| - name: Verify binary exists | ||
| run: test -x vermeer | ||
|
|
||
| - name: Verify release metadata exists | ||
| run: | | ||
| test -f release-docs/LICENSE | ||
| test -f release-docs/NOTICE | ||
| test -d release-docs/licenses | ||
|
|
||
| vermeer-docker: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Build Docker image (dry-run) | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: vermeer | ||
| push: false | ||
| tags: vermeer:ci-check | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
|
|
||
| - name: Verify release metadata in image | ||
| run: | | ||
| docker run --rm --entrypoint test vermeer:ci-check -f /go/bin/release-docs/LICENSE | ||
| docker run --rm --entrypoint test vermeer:ci-check -f /go/bin/release-docs/NOTICE | ||
| docker run --rm --entrypoint test vermeer:ci-check -d /go/bin/release-docs/licenses |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,16 +15,19 @@ | |
| # limitations under the License. | ||
| # | ||
| FROM golang:1.23-alpine AS builder | ||
| RUN apk add --no-cache npm bash curl | ||
| COPY ./ /src/ | ||
| WORKDIR /src/ | ||
| ENV CGO_ENABLED="0" | ||
| RUN ./scripts/download_ui_assets.sh | ||
| RUN cd asset && go generate | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Evidence: this PR adds npm asset downloads, |
||
| RUN go build -o /go/bin/app | ||
|
|
||
| FROM alpine | ||
| EXPOSE 8080 | ||
| COPY --from=builder /go/bin/app /go/bin/app | ||
| COPY --from=builder /src/config/ /go/bin/config/ | ||
| COPY --from=builder /src/release-docs/ /go/bin/release-docs/ | ||
| COPY --from=builder /usr/local/go/lib/time/zoneinfo.zip / | ||
| ENV TZ=Asia/Shanghai | ||
| ENV ZONEINFO=/zoneinfo.zip | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Evidence: this Docker build now downloads UI assets and embeds them into
/go/bin/app, while the final stage only copies the binary, config, and zoneinfo. Impact: the image redistributes the bundled frontend assets without therelease-docs/LICENSE,release-docs/NOTICE, and license bundle that the tarball path now carries. Please copy the release metadata into the final image, or otherwise make the same notice bundle available in the shipped image.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done