From ee9e80ddb1a5cba9048aec02c53f83b69e31bc76 Mon Sep 17 00:00:00 2001 From: Qian Deng Date: Thu, 23 Aug 2018 17:54:54 +0800 Subject: [PATCH] Delete uilib directory Not need publish version after ci suceess any more, so remove them Signed-off-by: Qian Deng --- tools/ui_lib/build_ui_lib_4_vic.sh | 25 ----------------------- tools/ui_lib/get_npm_token.py | 32 ------------------------------ 2 files changed, 57 deletions(-) delete mode 100755 tools/ui_lib/build_ui_lib_4_vic.sh delete mode 100755 tools/ui_lib/get_npm_token.py diff --git a/tools/ui_lib/build_ui_lib_4_vic.sh b/tools/ui_lib/build_ui_lib_4_vic.sh deleted file mode 100755 index 08d0f2271..000000000 --- a/tools/ui_lib/build_ui_lib_4_vic.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -set -e - -# Generate new version number by git tag and drone id -base_version="0.5" -version_config="\"version\": \"$base_version.$DRONE_BUILD_NUMBER\"" -harbor_root="/drone/src/github.com/vmware/harbor" -ui_lib_path="/src/ui_ng/lib" -npm_token_script_path="/tools/ui_lib/get_npm_token.py" - -TOKEN=$($harbor_root$npm_token_script_path) -npm set //registry.npmjs.org/:_authToken $TOKEN - -echo "Build harbor-ui lib ..." -cd $harbor_root$ui_lib_path -npm install -npm run build - -echo "Update package file for VIC ..." -cd ./dist -# update lib name for VIC -sed -i -e 's/harbor-ui/harbor-ui-vic/1' package.json -# update drone number based version number -sed -i -e "s/\"version\":[[:space:]]\".*\"/$version_config/g" package.json -npm publish \ No newline at end of file diff --git a/tools/ui_lib/get_npm_token.py b/tools/ui_lib/get_npm_token.py deleted file mode 100755 index 6ee41143c..000000000 --- a/tools/ui_lib/get_npm_token.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -This is a script to get npm token -""" - -import os -import json -import httplib - - -def main(): - """ - get token from npm - """ - username = os.getenv("NPM_USERNAME") - password = os.getenv("NPM_PASSWORD") - - headers = {'Accept': 'application/json', 'Content-Type': 'application/json'} - auth = {'name': username, 'password': password} - data = json.dumps(auth) - conn = httplib.HTTPSConnection("registry.npmjs.org") - conn.request('PUT', '/-/user/org.couchdb.user:{name}'.format(**auth), data, headers) - res = conn.getresponse() - - if int(res.status) / 100 != 2: - raise Exception("npm response not 2XX status") - print json.loads(res.read())['token'] - -if __name__ == '__main__': - main()