Skip to content

Commit

Permalink
Unify Build Process
Browse files Browse the repository at this point in the history
- Add `make web-build` to goreleaser `before`
- Add NPM and NODE to dockerfile so website can be built in goreleaser process
  • Loading branch information
CannonLock committed Mar 22, 2024
1 parent dd2d957 commit 5b7640b
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 18 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/go-generate-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Check Go Generate Has been Run
on:
pull_request:
jobs:
validate-generated-files:
name: Check Go Generate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.21"

- name: Run Go Generate
run: go generate ./...

- name: Validate Generated Files are up to date
run: |
if git diff --quiet; then
echo "No changes found."
else
echo "Changes detected. Here are the details:"
git diff
exit 1
fi
3 changes: 0 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Build the website
run: |
make web-build
- name: Set up Go
uses: actions/setup-go@v5
with:
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ before:
hooks:
- go mod tidy
- go generate ./...
- make web-build USE_DOCKER=1
- make web-build
builds:
- env:
- CGO_ENABLED=0
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ repos:
- id: trailing-whitespace
exclude: github_scripts/pelican_protocol.patch
- id: end-of-file-fixer
exclude-types: [json]
- id: check-yaml
# Multi-documents are yaml files with multiple --- separating blocks, like
# in our docs/parameters.yaml. We need this argument so those parse.
Expand Down
2 changes: 1 addition & 1 deletion docs/parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -2376,4 +2376,4 @@
"type": "string"
}
}
]
]
2 changes: 1 addition & 1 deletion docs/parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ name: Logging.DisableProgressBars
description: >-
A bool defining if progress bars should be enabled or not.
type: bool
default: false
default: true
components: ["Client"]
---
name: Logging.Origin.Cms
Expand Down
13 changes: 2 additions & 11 deletions images/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,11 @@
ARG BASE_YUM_REPO=release
ARG BASE_OSG_SERIES=3.6

FROM node:20 AS website-build

WORKDIR /webapp

COPY web_ui/frontend/package.json package.json

RUN npm install
COPY web_ui/frontend ./

RUN npm run build

FROM goreleaser/goreleaser:v1.21.0 AS pelican-build
ARG IS_NONRELEASE_BUILD="true"

RUN apk add --update nodejs-current npm

WORKDIR /pelican

COPY . .
Expand Down
2 changes: 1 addition & 1 deletion web_ui/frontend/public/data/parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -2376,4 +2376,4 @@
"type": "string"
}
}
]
]

0 comments on commit 5b7640b

Please sign in to comment.