Merge pull request #9431 from wy65701436/fix-build-offline

add npm registry when to build offline package in drone CI
This commit is contained in:
Wang Yan 2019-10-17 14:57:12 +08:00 committed by GitHub
commit b231814533
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 9 deletions

View File

@ -93,6 +93,7 @@ export Harbor_UI_Version=$Harbor_UI_Version
export Harbor_Assets_Version=$Harbor_Assets_Version
# the env is for online and offline package.
export Harbor_Package_Version=$Harbor_Package_Version
export NPM_REGISTRY=$NPM_REGISTRY
echo "--------------------------------------------------"
echo "Harbor UI version: $Harbor_UI_Version"
@ -193,14 +194,14 @@ if [ $upload_latest_build == true ] && [ $upload_bundle_success == true ]; then
fi
## --------------------------------------------- Upload securego results ------------------------------------------
if [ $DRONE_BUILD_EVENT == "push" ]; then
go get github.com/securego/gosec/cmd/gosec
go get github.com/dghubble/sling
make gosec -e GOSECRESULTS=harbor-gosec-results-latest.json
echo $git_commit > ./harbor-gosec-results-latest-version
uploader harbor-gosec-results-latest.json $harbor_target_bucket
uploader harbor-gosec-results-latest-version $harbor_target_bucket
fi
#if [ $DRONE_BUILD_EVENT == "push" ]; then
# go get github.com/securego/gosec/cmd/gosec
# go get github.com/dghubble/sling
# make gosec -e GOSECRESULTS=harbor-gosec-results-latest.json
# echo $git_commit > ./harbor-gosec-results-latest-version
# uploader harbor-gosec-results-latest.json $harbor_target_bucket
# uploader harbor-gosec-results-latest-version $harbor_target_bucket
#fi
## ------------------------------------------------ Tear Down -----------------------------------------------------
if [ -f "$keyfile" ]; then

View File

@ -55,7 +55,7 @@ Package Harbor Offline
[Arguments] ${with_notary}=true ${with_clair}=true ${with_migrator}=false ${with_chartmuseum}=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} NOTARYFLAG=${with_notary} CLAIRFLAG=${with_clair} MIGRATORFLAG=${with_migrator} CHARTFLAG=${with_chartmuseum} HTTPPROXY=
Log To Console \n\nmake package_offline NPM_REGISTRY=%{NPM_REGISTRY} VERSIONTAG=%{Harbor_Assets_Version} PKGVERSIONTAG=%{Harbor_Package_Version} UIVERSIONTAG=%{Harbor_UI_Version} NOTARYFLAG=${with_notary} CLAIRFLAG=${with_clair} MIGRATORFLAG=${with_migrator} CHARTFLAG=${with_chartmuseum} HTTPPROXY=
${rc} ${output}= Run And Return Rc And Output make package_offline VERSIONTAG=%{Harbor_Assets_Version} PKGVERSIONTAG=%{Harbor_Package_Version} UIVERSIONTAG=%{Harbor_UI_Version} NOTARYFLAG=${with_notary} CLAIRFLAG=${with_clair} MIGRATORFLAG=${with_migrator} CHARTFLAG=${with_chartmuseum} HTTPPROXY=
Log ${rc}
Log ${output}