From 29845dbcca2841f0ffe9a99c3cf9e8ff31bb8d03 Mon Sep 17 00:00:00 2001 From: wangyan Date: Fri, 21 Apr 2017 02:08:13 -0700 Subject: [PATCH] add clarity support --- Makefile | 22 ++++++++++++++++++++++ make/dev/nodeclarity/Dockerfile | 4 ++-- make/dev/nodeclarity/entrypoint.sh | 11 ++++++++++- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6faa7dc65..629158e7a 100644 --- a/Makefile +++ b/Makefile @@ -86,6 +86,8 @@ NOTARYVERSION=server-0.5.0 NOTARYSIGNERVERSION=signer-0.5.0 MARIADBVERSION=mariadb-10.1.10 HTTPPROXY= +REBUILDCLARITYFLAG=false +NEWCLARITYVERSION= #clarity parameters CLARITYIMAGE=vmware/harbor-clarity-ui-builder[:tag] @@ -149,6 +151,7 @@ MAKEFILEPATH_PHOTON=$(MAKEPATH)/photon DOCKERFILEPATH_COMMON=$(MAKEPATH)/common DOCKERFILEPATH_DB=$(DOCKERFILEPATH_COMMON)/db DOCKERFILENAME_DB=Dockerfile +DOCKERFILE_CLARITY=$(MAKEPATH)/dev/nodeclarity/Dockerfile # docker image name DOCKERIMAGENAME_ADMINSERVER=vmware/harbor-adminserver @@ -156,6 +159,7 @@ DOCKERIMAGENAME_UI=vmware/harbor-ui DOCKERIMAGENAME_JOBSERVICE=vmware/harbor-jobservice DOCKERIMAGENAME_LOG=vmware/harbor-log DOCKERIMAGENAME_DB=vmware/harbor-db +DOCKERIMAGENAME_CLATIRY=vmware/harbor-clarity-ui-builder # docker-compose files DOCKERCOMPOSEFILEPATH=$(MAKEPATH) @@ -354,6 +358,24 @@ package_offline: compile build modify_sourcefiles modify_composefile @rm -rf $(HARBORPKG) @echo "Done." + +refresh_clarity_builder: + @if [ "$(REBUILDCLIATRYFLAG)" = "true" ] ; then \ + echo "set http proxy.."; \ + if [ "$(HTTPPROXY)" != "" ] ; then \ + $(SEDCMD) -i 's/__proxy__/--proxy $(HTTPPROXY)/g' $(DOCKERFILE_CLARITY) ; \ + else \ + $(SEDCMD) -i 's/__proxy__/ /g' $(DOCKERFILE_CLARITY) ; \ + fi ; \ + echo "build new clarity image.."; \ + $(DOCKERBUILD) -f $(DOCKERFILE_CLARITY) -t $(DOCKERIMAGENAME_CLATIRY):$(NEWCLARITYVERSION) . ; \ + echo "push clarity image.."; \ + $(DOCKERTAG) $(DOCKERIMAGENAME_CLATIRY):$(NEWCLARITYVERSION) $(DOCKERIMAGENAME_CLATIRY):$(NEWCLARITYVERSION); \ + $(PUSHSCRIPTPATH)/$(PUSHSCRIPTNAME) $(REGISTRYSERVER)$(DOCKERIMAGENAME_CLATIRY):$(NEWCLARITYVERSION) \ + $(REGISTRYUSER) $(REGISTRYPASSWORD) $(REGISTRYSERVER); \ + echo "remove local clarity image.."; \ + $(DOCKERRMIMAGE) $(REGISTRYSERVER)$(DOCKERIMAGENAME_ADMINSERVER):$(NEWCLARITYVERSION); \ + fi pushimage: @echo "pushing harbor images ..." diff --git a/make/dev/nodeclarity/Dockerfile b/make/dev/nodeclarity/Dockerfile index 30a167cdd..b98d48f17 100644 --- a/make/dev/nodeclarity/Dockerfile +++ b/make/dev/nodeclarity/Dockerfile @@ -11,8 +11,8 @@ COPY make/dev/nodeclarity/entrypoint.sh / WORKDIR /clarity-seed -RUN npm install -g @angular/cli && \ - npm install && \ +RUN npm __proxy__ install -g @angular/cli && \ + npm __proxy__ install && \ chmod u+x /entrypoint.sh VOLUME ["/clarity-seed", "/clarity-seed/dist"] \ No newline at end of file diff --git a/make/dev/nodeclarity/entrypoint.sh b/make/dev/nodeclarity/entrypoint.sh index 25bcc6df3..472dab360 100644 --- a/make/dev/nodeclarity/entrypoint.sh +++ b/make/dev/nodeclarity/entrypoint.sh @@ -19,7 +19,16 @@ if [ ! -z "$npm_proxy" -a "$npm_proxy" != " " ]; then fi npm install -ng build + +./node_modules/.bin/ngc -p tsconfig-aot.json +sed -i 's/* as//g' src/app/shared/gauge/gauge.component.js +./node_modules/.bin/rollup -c rollup-config.js cp -r ./src/i18n/ dist/ +cp ./node_modules/clarity-icons/clarity-icons.min.css dist/ +cp ./node_modules/mutationobserver-shim/dist/mutationobserver.min.js dist/ +cp ./node_modules/@webcomponents/custom-elements/custom-elements.min.js dist/ +cp ./node_modules/clarity-icons/clarity-icons.min.js dist/ +cp ./node_modules/clarity-ui/clarity-ui.min.css dist/ +cp -r ./node_modules/clarity-icons/shapes/ dist/