1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-06 06:15:22 +02:00

fix(buildscripts): make build process more closely resemble EE (#8881)

This commit is contained in:
Matt Hook 2023-05-03 17:13:28 +12:00 committed by GitHub
parent 98e6393274
commit 58d130ee37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 56 deletions

View file

@ -5,6 +5,7 @@ PLATFORM=$(shell go env GOOS)
ARCH=$(shell go env GOARCH)
TAG=latest
SWAG_VERSION=v1.8.11
# build target, can be one of "production", "testing", "development"
ENV=development
@ -17,21 +18,21 @@ WEBPACK_CONFIG=webpack/webpack.$(ENV).js
##@ Building
init-dist:
mkdir -p dist
@mkdir -p dist
build-storybook:
yarn storybook:build
build-client: init-dist ## Build the client
@export NODE_ENV=$(ENV) && yarn build --config $(WEBPACK_CONFIG)
build-server: init-dist ## Build the server binary
@./build/build_binary.sh "$(PLATFORM)" "$(ARCH)"
build: build-server build-client ## Build the server and client
build-client: init-dist client-deps ## Build the client
export NODE_ENV=$(ENV) && yarn build --config $(WEBPACK_CONFIG)
build-server: init-dist ## Build the server binary
./build/build_binary.sh "$(PLATFORM)" "$(ARCH)"
build-image: build ## Build the Portainer image
docker build -t portainerci/portainer:$(TAG) -f build/linux/Dockerfile .
docker buildx build --load -t portainerci/portainer:$(TAG) -f build/linux/Dockerfile .
devops: clean init-dist download-binaries build-client ## Build the server binary for CI
echo "Building the devops binary..."
@ -66,6 +67,9 @@ test: test-client test-server ## Run all tests
##@ Dev
dev-client: ## Run the client in development mode
yarn dev
dev-server: build-image ## Run the server in development mode
@./dev/run_container.sh
@ -82,14 +86,14 @@ format: format-client format-server ## Format all code
##@ Lint
lint: lint-client lint-server ## Lint all code
lint-client: ## Lint client code
yarn lint
lint-server: ## Lint server code
cd api && go vet ./...
lint: lint-client lint-server ## Lint all code
##@ Extension
dev-extension: build-server build-client ## Run the extension in development mode
@ -98,7 +102,7 @@ dev-extension: build-server build-client ## Run the extension in development mod
##@ Docs
docs-deps: ## Install docs dependencies
go install github.com/swaggo/swag/cmd/swag@v1.8.11
go install github.com/swaggo/swag/cmd/swag@$(SWAG_VERSION)
docs-build: docs-deps ## Build docs
cd api && swag init -g ./http/handler/handler.go --parseDependency --parseInternal --parseDepth 2 --markdownFiles ./