From d366134fe8f0577d9aa495aceb7e3cd172092c15 Mon Sep 17 00:00:00 2001 From: Yan Date: Wed, 4 Jul 2018 20:03:44 +0800 Subject: [PATCH] Fix bug of packaging offline installer (#5245) The init sql script name nad path was changed by PR #5197, this commit is to update these and log the package command to console, make it more easy to debug in future. Also remove the action to pull migrator as it will built each time locally. --- Makefile | 12 +++--------- make/photon/Makefile | 2 +- tests/resources/Harbor-Util.robot | 2 ++ 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index ce7ca1fb2..649b1ca2e 100644 --- a/Makefile +++ b/Makefile @@ -102,7 +102,7 @@ NOTARYVERSION=v0.5.1 MARIADBVERSION=$(VERSIONTAG) CLAIRVERSION=v2.0.1 CLAIRDBVERSION=$(VERSIONTAG) -MIGRATORVERSION=v1.6.0 +MIGRATORVERSION=$(VERSIONTAG) REDISVERSION=$(VERSIONTAG) #clarity parameters @@ -210,7 +210,6 @@ DOCKERSAVE_PARA=$(DOCKERIMAGENAME_ADMINSERVER):$(VERSIONTAG) \ $(DOCKERIMAGENAME_DB):$(VERSIONTAG) \ $(DOCKERIMAGENAME_JOBSERVICE):$(VERSIONTAG) \ vmware/redis-photon:$(REDISVERSION) \ - vmware/harbor-migrator:$(VERSIONTAG) \ vmware/nginx-photon:$(NGINXVERSION) vmware/registry-photon:$(REGISTRYVERSION)-$(VERSIONTAG) \ vmware/photon:$(PHOTONVERSION) PACKAGE_OFFLINE_PARA=-zcvf harbor-offline-installer-$(PKGVERSIONTAG).tgz \ @@ -284,7 +283,7 @@ build: make -f $(MAKEFILEPATH_PHOTON)/Makefile build -e DEVFLAG=$(DEVFLAG) -e MARIADBVERSION=$(MARIADBVERSION) \ -e REGISTRYVERSION=$(REGISTRYVERSION) -e NGINXVERSION=$(NGINXVERSION) -e NOTARYVERSION=$(NOTARYVERSION) \ -e CLAIRVERSION=$(CLAIRVERSION) -e CLAIRDBVERSION=$(CLAIRDBVERSION) -e VERSIONTAG=$(VERSIONTAG) \ - -e BUILDBIN=$(BUILDBIN) -e REDISVERSION=$(REDISVERSION) + -e BUILDBIN=$(BUILDBIN) -e REDISVERSION=$(REDISVERSION) -e MIGRATORVERSION=$(MIGRATORVERSION) modify_composefile: modify_composefile_notary modify_composefile_clair @echo "preparing docker-compose file..." @@ -344,12 +343,7 @@ package_offline: compile version build modify_sourcefiles modify_composefile @cp -r make $(HARBORPKG) @cp LICENSE $(HARBORPKG)/LICENSE @cp NOTICE $(HARBORPKG)/NOTICE - @cp $(HARBORPKG)/photon/db/registry.sql $(HARBORPKG)/ha/ - - @if [ "$(MIGRATORFLAG)" = "true" ] ; then \ - echo "pulling Harbor migrator..."; \ - $(DOCKERPULL) vmware/harbor-migrator:$(MIGRATORVERSION); \ - fi + @cp $(HARBORPKG)/photon/db/initial-registry.sql $(HARBORPKG)/ha/ @echo "saving harbor docker image" @$(DOCKERSAVE) $(DOCKERSAVE_PARA) > $(HARBORPKG)/$(DOCKERIMGFILE).$(VERSIONTAG).tar diff --git a/make/photon/Makefile b/make/photon/Makefile index fd9bd7c98..a5dbf62e5 100644 --- a/make/photon/Makefile +++ b/make/photon/Makefile @@ -166,7 +166,7 @@ _build_redis: _build_migrator: @echo "building db migrator container for photon..." - @cd $(DOCKERFILEPATH_MIGRATOR) && $(DOCKERBUILD) -f $(DOCKERFILEPATH_MIGRATOR)/$(DOCKERFILENAME_MIGRATOR) -t $(DOCKERIMAGENAME_MIGRATOR):$(VERSIONTAG) . + @cd $(DOCKERFILEPATH_MIGRATOR) && $(DOCKERBUILD) -f $(DOCKERFILEPATH_MIGRATOR)/$(DOCKERFILENAME_MIGRATOR) -t $(DOCKERIMAGENAME_MIGRATOR):$(MIGRATORVERSION) . @echo "Done." define _get_binary diff --git a/tests/resources/Harbor-Util.robot b/tests/resources/Harbor-Util.robot index 32cded988..e638f6659 100644 --- a/tests/resources/Harbor-Util.robot +++ b/tests/resources/Harbor-Util.robot @@ -58,6 +58,7 @@ Package Harbor Offline [Arguments] ${golang_image}=golang:${GOLANG_VERSION} ${clarity_image}=vmware/harbor-clarity-ui-builder:${CLAIR_BUILDER} ${with_notary}=true ${with_clair}=true ${with_migrator}=true Log To Console \nStart Docker Daemon Start Docker Daemon Locally + Log To Console \n\nmake package_offline VERSIONTAG=%{Harbor_Assets_Version} PKGVERSIONTAG=%{Harbor_Package_Version} UIVERSIONTAG=%{Harbor_UI_Version} GOBUILDIMAGE=${golang_image} COMPILETAG=compile_golangimage CLARITYIMAGE=${clarity_image} NOTARYFLAG=${with_notary} CLAIRFLAG=${with_clair} MIGRATORFLAG=${with_migrator} HTTPPROXY= ${rc} ${output}= Run And Return Rc And Output make package_offline VERSIONTAG=%{Harbor_Assets_Version} PKGVERSIONTAG=%{Harbor_Package_Version} UIVERSIONTAG=%{Harbor_UI_Version} GOBUILDIMAGE=${golang_image} COMPILETAG=compile_golangimage CLARITYIMAGE=${clarity_image} NOTARYFLAG=${with_notary} CLAIRFLAG=${with_clair} MIGRATORFLAG=${with_migrator} HTTPPROXY= Log ${rc} Log ${output} @@ -67,6 +68,7 @@ Package Harbor Online [Arguments] ${golang_image}=golang:${GOLANG_VERSION} ${clarity_image}=vmware/harbor-clarity-ui-builder:${CLAIR_BUILDER} ${with_notary}=true ${with_clair}=true ${with_migrator}=true Log To Console \nStart Docker Daemon Start Docker Daemon Locally + Log To Console \nmake package_online VERSIONTAG=%{Harbor_Assets_Version} PKGVERSIONTAG=%{Harbor_Package_Version} UIVERSIONTAG=%{Harbor_UI_Version} GOBUILDIMAGE=${golang_image} COMPILETAG=compile_golangimage CLARITYIMAGE=${clarity_image} NOTARYFLAG=${with_notary} CLAIRFLAG=${with_clair} MIGRATORFLAG=${with_migrator} HTTPPROXY= ${rc} ${output}= Run And Return Rc And Output make package_online VERSIONTAG=%{Harbor_Assets_Version} PKGVERSIONTAG=%{Harbor_Package_Version} UIVERSIONTAG=%{Harbor_UI_Version} GOBUILDIMAGE=${golang_image} COMPILETAG=compile_golangimage CLARITYIMAGE=${clarity_image} NOTARYFLAG=${with_notary} CLAIRFLAG=${with_clair} MIGRATORFLAG=${with_migrator} HTTPPROXY= Log ${rc} Log ${output}