Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ docs/parameters.json
web_ui/frontend/public/data/parameters.json
local
web_ui/frontend/app/api/docs/pelican-swagger.yaml
.goreleaser.dev.yml
25 changes: 13 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,13 @@ endif
WEBSITE_SRC_PATH := web_ui/frontend
WEBSITE_OUT_PATH := web_ui/frontend/out
WEBSITE_CACHE_PATH := web_ui/frontend/.next
WEBSITE_SRC_FILES := $(shell find $(WEBSITE_SRC_PATH)/app -type f) \
$(shell find $(WEBSITE_SRC_PATH)/components -type f) \
$(shell find $(WEBSITE_SRC_PATH)/helpers -type f) \
$(shell find $(WEBSITE_SRC_PATH)/public -type f) \
web_ui/frontend/tsconfig.json \
web_ui/frontend/next.config.js \
web_ui/frontend/package.json \
web_ui/frontend/package-lock.json \
web_ui/frontend/Dockerfile

WEBSITE_OUT_FILE := $(WEBSITE_OUT_FILES)/index.html

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")
WEBSITE_CLEAN_LIST := $(WEBSITE_OUT_PATH) \
$(WEBSITE_CACHE_PATH)

$(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)])


.PHONY: all
all: pelican-build
Expand Down Expand Up @@ -96,7 +88,7 @@ else
web-build: generate web_ui/frontend/out/index.html
endif

web_ui/frontend/out/index.html : $(WEBSITE_SRC_FILES)
web_ui/frontend/out/index.html : $(WEBSITE_SRC_FILES) swagger/pelican-swagger.yaml
Comment thread
CannonLock marked this conversation as resolved.
ifeq ($(USE_DOCKER),0)
@cd $(WEBSITE_SRC_PATH) && npm install && npm run build
else
Expand Down Expand Up @@ -128,6 +120,15 @@ else
@$(CONTAINER_TOOL) run -w /app -v $(PWD):/app goreleaser/goreleaser --clean --snapshot
endif

.PHONY: pelican-dev-build
pelican-dev-build:
@echo PELICAN DEV BUILD
ifeq ($(USE_DOCKER),0)
@goreleaser --clean --snapshot --config .goreleaser.dev.yml
else
@$(CONTAINER_TOOL) run -w /app -v $(PWD):/app goreleaser/goreleaser --clean --snapshot --config .goreleaser.dev.yml
endif

.PHONY: pelican-serve-test-origin
pelican-serve-test-origin: pelican-build
@echo SERVE TEST ORIGIN
Expand Down
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,49 @@ Building is performed with the [goreleaser](https://goreleaser.com/) tool. To b
$ goreleaser --clean --snapshot

The binaries will be located in `./dist` directory.

## Building for Development

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.

### Example `.goreleaser.dev.yml` File
```
project_name: pelican
version: 2

release:
prerelease: true
before:
hooks:
- go mod tidy
- go generate ./...
- make web-build
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- "amd64"
- "arm64"
id: "pelican"
dir: ./cmd
binary: pelican
tags:
- forceposix
ldflags:
- -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}}
ignore:
- goos: windows
goarch: arm64
- goos: windows
goarch: ppc64le
- goos: darwin
goarch: ppc64le
```

### Build using the dev file
```
make pelican-dev-build
```
Loading