Skip to content

Commit 97c9cdc

Browse files
author
Jeff
committed
add build support for multiple platforms
1 parent dc20a67 commit 97c9cdc

20 files changed

+128
-448
lines changed

.dockerignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.editorconfig

Lines changed: 0 additions & 16 deletions
This file was deleted.

.eslintignore

Lines changed: 0 additions & 9 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 116 deletions
This file was deleted.

.github/workflows/main.yaml

Lines changed: 0 additions & 68 deletions
This file was deleted.

.github/workflows/nightly-builds.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ yarn-error.log*
2424
*.rdb
2525
/build
2626
.cache-loader
27+
.vscode

.prettierignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.prettierrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

Dockerfile

Lines changed: 0 additions & 10 deletions
This file was deleted.

Dockerfile.arm64

Lines changed: 0 additions & 10 deletions
This file was deleted.

Dockerfile.multistage

Lines changed: 0 additions & 18 deletions
This file was deleted.

Makefile

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,34 @@
1-
REPO?=kubespheredev/ks-console
2-
TAG?=$(shell git rev-parse --abbrev-ref HEAD | sed -e 's/\//-/g' | sed 's/master/latest/g')-dev
1+
# Copyright 2021 The KubeSphere Authors. All rights reserved.
2+
# Use of this source code is governed by a AGPL-3.0 license
3+
# that can be found in the LICENSE file.
34

4-
setup:
5-
docker volume create nodemodules
5+
REPO?=kubespheredev
6+
TAG?=$(shell git rev-parse --abbrev-ref HEAD)
67

7-
install:
8-
docker-compose -f docker-compose.builder.yaml run --rm install
8+
.PHONY: all
9+
all: test build serve
910

10-
dev:
11-
docker-compose up
11+
help: ## Show this help.
12+
@grep -hE '^[ a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
13+
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-23s\033[0m %s\n", $$1, $$2}'
1214

13-
build:
14-
docker-compose -f docker-compose.builder.yaml run --rm build
15+
test: ## Run tests suite.
16+
yarn test
1517

16-
yarn-%:
17-
docker-compose -f docker-compose.builder.yaml run --rm base yarn $*
18+
build: ## Build
19+
yarn build
1820

19-
image:
20-
rm -rf build && mkdir -p build
21-
tar --exclude=".git" --exclude='node_modules' --exclude='build' --warning=no-file-changed -czf build/console.tar.gz .
22-
docker build build -t $(REPO):$(TAG) -f Dockerfile.multistage
23-
image-push:
24-
docker push $(REPO):$(TAG)
21+
serve: ## Run console on port :8000
22+
npm run serve
23+
24+
container: ## Build the container image
25+
DRY_RUN=true hack/docker_build.sh
26+
27+
container-push: ## Build the container and push
28+
hack/docker_build.sh
29+
30+
container-cross: ## Build the container for multiple platforms(currently linux/amd64,linux/arm64)
31+
DRY_RUN=true hack/docker_build_multiarch.sh
32+
33+
container-cross-push: ## Build the container for multiple platforms and push
34+
hack/docker_build_multiarch.sh

0 commit comments

Comments
 (0)