From 7c68c1ca696850334c4b19cfed2dd9953fceab0c Mon Sep 17 00:00:00 2001 From: Steven Zou Date: Fri, 23 Jun 2017 17:31:05 +0800 Subject: [PATCH] Enhance script in make/dev/nodeclarity/entrypoint.sh --- .travis.yml | 4 ++-- Makefile | 9 +++++---- docs/compile_guide.md | 4 ++-- make/dev/nodeclarity/entrypoint.sh | 1 + .../app/project/list-project/list-project.component.html | 2 +- .../app/project/list-project/list-project.component.ts | 1 + src/ui_ng/src/app/project/project.component.html | 2 +- src/ui_ng/src/app/project/project.component.ts | 9 ++++++++- tests/run-clarity-ut.sh | 6 ++++-- 9 files changed, 25 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index ae7271bcf..c92b4918a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -80,7 +80,7 @@ script: - sudo mkdir -p /harbor - sudo mv ./VERSION /harbor/VERSION - sudo service mysql stop - - sudo make run_clarity_ut CLARITYIMAGE=vmware/harbor-clarity-ui-builder:1.2.5 + - sudo make run_clarity_ut CLARITYIMAGE=vmware/harbor-clarity-ui-builder:1.2.6 - cat ./src/ui_ng/lib/npm-ut-test-results - sudo ./tests/testprepare.sh - sudo docker-compose -f ./make/docker-compose.test.yml up -d @@ -101,7 +101,7 @@ script: - docker-compose -f make/docker-compose.test.yml down - sudo rm -rf /data/config/* - ls /data/cert - - sudo make install GOBUILDIMAGE=golang:1.7.3 COMPILETAG=compile_golangimage CLARITYIMAGE=vmware/harbor-clarity-ui-builder:1.2.5 NOTARYFLAG=true + - sudo make install GOBUILDIMAGE=golang:1.7.3 COMPILETAG=compile_golangimage CLARITYIMAGE=vmware/harbor-clarity-ui-builder:1.2.6 NOTARYFLAG=true - docker ps - ./tests/notarytest.sh diff --git a/Makefile b/Makefile index ee3b6ee35..145ca834a 100644 --- a/Makefile +++ b/Makefile @@ -96,7 +96,8 @@ CLAIRDBVERSION=9.6.3 #clarity parameters CLARITYIMAGE=vmware/harbor-clarity-ui-builder[:tag] -CLARITYSEEDPATH=/harbor_ui +CLARITYSEEDPATH=/harbor_src +CLARITYUTPATH=${CLARITYSEEDPATH}/ui_ng/lib CLARITYBUILDSCRIPT=/entrypoint.sh # docker parameters @@ -266,9 +267,9 @@ compile_jobservice: compile_clarity: @echo "compiling binary for clarity ui..." @if [ "$(HTTPPROXY)" != "" ] ; then \ - $(DOCKERCMD) run --rm -v $(UIPATH)/static:$(CLARITYSEEDPATH)/dist -v $(UINGPATH)/src:$(CLARITYSEEDPATH)/src $(CLARITYIMAGE) $(SHELL) $(CLARITYBUILDSCRIPT) -p $(HTTPPROXY); \ + $(DOCKERCMD) run --rm -v $(SRCPATH):$(CLARITYSEEDPATH) $(CLARITYIMAGE) $(SHELL) $(CLARITYBUILDSCRIPT) -p $(HTTPPROXY); \ else \ - $(DOCKERCMD) run --rm -v $(UIPATH)/static:$(CLARITYSEEDPATH)/dist -v $(UINGPATH)/src:$(CLARITYSEEDPATH)/src $(CLARITYIMAGE) $(SHELL) $(CLARITYBUILDSCRIPT); \ + $(DOCKERCMD) run --rm -v $(SRCPATH):$(CLARITYSEEDPATH) $(CLARITYIMAGE) $(SHELL) $(CLARITYBUILDSCRIPT); \ fi @echo "Done." @@ -389,7 +390,7 @@ refresh_clarity_builder: run_clarity_ut: @echo "run clarity ut ..." - @$(DOCKERCMD) run --rm -v $(UINGPATH)/lib:$(CLARITYSEEDPATH)/lib -v $(BUILDPATH)/tests:$(CLARITYSEEDPATH)/tests $(CLARITYIMAGE) $(SHELL) $(CLARITYSEEDPATH)/tests/run-clarity-ut.sh + @$(DOCKERCMD) run --rm -v $(UINGPATH)/lib:$(CLARITYSEEDPATH) -v $(BUILDPATH)/tests:$(CLARITYSEEDPATH)/tests $(CLARITYIMAGE) $(SHELL) $(CLARITYSEEDPATH)/tests/run-clarity-ut.sh pushimage: @echo "pushing harbor images ..." diff --git a/docs/compile_guide.md b/docs/compile_guide.md index 3440893f5..f90c05275 100644 --- a/docs/compile_guide.md +++ b/docs/compile_guide.md @@ -50,13 +50,13 @@ You can compile the code by one of the three approaches: * Build, install and bring up Harbor without Notary: ```sh - $ make install GOBUILDIMAGE=golang:1.7.3 COMPILETAG=compile_golangimage CLARITYIMAGE=vmware/harbor-clarity-ui-builder:1.2.5 + $ make install GOBUILDIMAGE=golang:1.7.3 COMPILETAG=compile_golangimage CLARITYIMAGE=vmware/harbor-clarity-ui-builder:1.2.6 ``` * Build, install and bring up Harbor with Notary: ```sh - $ make install GOBUILDIMAGE=golang:1.7.3 COMPILETAG=compile_golangimage CLARITYIMAGE=vmware/harbor-clarity-ui-builder:1.2.5 NOTARYFLAG=true + $ make install GOBUILDIMAGE=golang:1.7.3 COMPILETAG=compile_golangimage CLARITYIMAGE=vmware/harbor-clarity-ui-builder:1.2.6 NOTARYFLAG=true ``` #### II. Compile code with your own Golang environment, then build Harbor diff --git a/make/dev/nodeclarity/entrypoint.sh b/make/dev/nodeclarity/entrypoint.sh index ee8bb1998..83a77724d 100644 --- a/make/dev/nodeclarity/entrypoint.sh +++ b/make/dev/nodeclarity/entrypoint.sh @@ -18,6 +18,7 @@ if [ ! -z "$npm_proxy" -a "$npm_proxy" != " " ]; then npm config set proxy $npm_proxy fi +rm -rf ./node_modules mv /harbor_resources/node_modules ./ cat ./package.json diff --git a/src/ui_ng/src/app/project/list-project/list-project.component.html b/src/ui_ng/src/app/project/list-project/list-project.component.html index 4529d2876..38f28c24a 100644 --- a/src/ui_ng/src/app/project/list-project/list-project.component.html +++ b/src/ui_ng/src/app/project/list-project/list-project.component.html @@ -1,4 +1,4 @@ - + {{'PROJECT.NAME' | translate}} {{'PROJECT.ACCESS_LEVEL' | translate}} {{'PROJECT.ROLE' | translate}} diff --git a/src/ui_ng/src/app/project/list-project/list-project.component.ts b/src/ui_ng/src/app/project/list-project/list-project.component.ts index b37dedf0b..10d3236a2 100644 --- a/src/ui_ng/src/app/project/list-project/list-project.component.ts +++ b/src/ui_ng/src/app/project/list-project/list-project.component.ts @@ -30,6 +30,7 @@ import { State } from 'clarity-angular'; export class ListProjectComponent { _filterType: string = ProjectTypes[0]; + @Input() loading: boolean = true; @Input() projects: Project[]; @Input() get filteredType(): string { diff --git a/src/ui_ng/src/app/project/project.component.html b/src/ui_ng/src/app/project/project.component.html index 44f3cb271..d1d6f09e1 100644 --- a/src/ui_ng/src/app/project/project.component.html +++ b/src/ui_ng/src/app/project/project.component.html @@ -25,6 +25,6 @@ - + \ No newline at end of file diff --git a/src/ui_ng/src/app/project/project.component.ts b/src/ui_ng/src/app/project/project.component.ts index 14fa0e999..97ef3cc0e 100644 --- a/src/ui_ng/src/app/project/project.component.ts +++ b/src/ui_ng/src/app/project/project.component.ts @@ -60,6 +60,7 @@ export class ProjectComponent implements OnInit, OnDestroy { projectName: string = ""; subscription: Subscription; + loading: boolean = true; constructor( private projectService: ProjectService, @@ -122,13 +123,19 @@ export class ProjectComponent implements OnInit, OnDestroy { } getProjects(name?: string, isPublic?: number, page?: number, pageSize?: number): void { + this.loading = true; + this.projectService .listProjects(name, isPublic, page, pageSize) .subscribe( response => { this.changedProjects = response.json(); + this.loading = false; }, - error => this.messageHandlerService.handleError(error) + error => { + this.loading = false; + this.messageHandlerService.handleError(error); + } ); } diff --git a/tests/run-clarity-ut.sh b/tests/run-clarity-ut.sh index 878e9656c..50d6a330b 100644 --- a/tests/run-clarity-ut.sh +++ b/tests/run-clarity-ut.sh @@ -2,9 +2,11 @@ set -e -cp -r /harbor_ui/lib/* /harbor_ui +cd /harbor_src + +mv /harbor_resources/node_modules ./ npm install -npm run test > lib/npm-ut-test-results +npm run test > ./npm-ut-test-results