Skip to content

Commit 9a39530

Browse files
authored
Merge pull request #2310 from PelicanPlatform/dev-qol
Dev QOL Update
2 parents a53078d + 7bc4b57 commit 9a39530

3 files changed

Lines changed: 60 additions & 12 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ docs/parameters.json
44
web_ui/frontend/public/data/parameters.json
55
local
66
web_ui/frontend/app/api/docs/pelican-swagger.yaml
7+
.goreleaser.dev.yml

Makefile

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,13 @@ endif
4545
WEBSITE_SRC_PATH := web_ui/frontend
4646
WEBSITE_OUT_PATH := web_ui/frontend/out
4747
WEBSITE_CACHE_PATH := web_ui/frontend/.next
48-
WEBSITE_SRC_FILES := $(shell find $(WEBSITE_SRC_PATH)/app -type f) \
49-
$(shell find $(WEBSITE_SRC_PATH)/components -type f) \
50-
$(shell find $(WEBSITE_SRC_PATH)/helpers -type f) \
51-
$(shell find $(WEBSITE_SRC_PATH)/public -type f) \
52-
web_ui/frontend/tsconfig.json \
53-
web_ui/frontend/next.config.js \
54-
web_ui/frontend/package.json \
55-
web_ui/frontend/package-lock.json \
56-
web_ui/frontend/Dockerfile
57-
58-
WEBSITE_OUT_FILE := $(WEBSITE_OUT_FILES)/index.html
5948

49+
WEBSITE_SRC_FILES := $(shell find $(WEBSITE_SRC_PATH) -type f -not -path "*.next*" -not -path "*/out/*" -not -path "*node_modules*" -not -path "*pelican-swagger.yaml")
6050
WEBSITE_CLEAN_LIST := $(WEBSITE_OUT_PATH) \
6151
$(WEBSITE_CACHE_PATH)
6252

53+
$(info These files have changed causing the website to have to rebuild: [$(shell find $(WEBSITE_SRC_PATH) -type f -not -path "*.next*" -not -path "*/out/*" -not -path "*node_modules*" -not -path "*pelican-swagger.yaml" -newer web_ui/frontend/out/index.html)])
54+
6355

6456
.PHONY: all
6557
all: pelican-build
@@ -96,7 +88,7 @@ else
9688
web-build: generate web_ui/frontend/out/index.html
9789
endif
9890

99-
web_ui/frontend/out/index.html : $(WEBSITE_SRC_FILES)
91+
web_ui/frontend/out/index.html : $(WEBSITE_SRC_FILES) swagger/pelican-swagger.yaml
10092
ifeq ($(USE_DOCKER),0)
10193
@cd $(WEBSITE_SRC_PATH) && npm install && npm run build
10294
else
@@ -128,6 +120,15 @@ else
128120
@$(CONTAINER_TOOL) run -w /app -v $(PWD):/app goreleaser/goreleaser --clean --snapshot
129121
endif
130122

123+
.PHONY: pelican-dev-build
124+
pelican-dev-build:
125+
@echo PELICAN DEV BUILD
126+
ifeq ($(USE_DOCKER),0)
127+
@goreleaser --clean --snapshot --config .goreleaser.dev.yml
128+
else
129+
@$(CONTAINER_TOOL) run -w /app -v $(PWD):/app goreleaser/goreleaser --clean --snapshot --config .goreleaser.dev.yml
130+
endif
131+
131132
.PHONY: pelican-serve-test-origin
132133
pelican-serve-test-origin: pelican-build
133134
@echo SERVE TEST ORIGIN

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,49 @@ Building is performed with the [goreleaser](https://goreleaser.com/) tool. To b
7575
$ goreleaser --clean --snapshot
7676

7777
The binaries will be located in `./dist` directory.
78+
79+
## Building for Development
80+
81+
To enable more rapid development you can include a `dev` goreleaser configuration. This allows you to only build the binaries that you will be using.
82+
83+
### Example `.goreleaser.dev.yml` File
84+
```
85+
project_name: pelican
86+
version: 2
87+
88+
release:
89+
prerelease: true
90+
before:
91+
hooks:
92+
- go mod tidy
93+
- go generate ./...
94+
- make web-build
95+
builds:
96+
- env:
97+
- CGO_ENABLED=0
98+
goos:
99+
- linux
100+
- darwin
101+
goarch:
102+
- "amd64"
103+
- "arm64"
104+
id: "pelican"
105+
dir: ./cmd
106+
binary: pelican
107+
tags:
108+
- forceposix
109+
ldflags:
110+
- -s -w -X github.com/pelicanplatform/pelican/version.commit={{.Commit}} -X github.com/pelicanplatform/pelican/version.date={{.Date}} -X github.com/pelicanplatform/pelican/version.builtBy=goreleaser -X github.com/pelicanplatform/pelican/version.version={{.Version}}
111+
ignore:
112+
- goos: windows
113+
goarch: arm64
114+
- goos: windows
115+
goarch: ppc64le
116+
- goos: darwin
117+
goarch: ppc64le
118+
```
119+
120+
### Build using the dev file
121+
```
122+
make pelican-dev-build
123+
```

0 commit comments

Comments
 (0)