mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-20 15:48:26 +01:00
Merge pull request #5718 from ninjadq/remove_uilib
Delete uilib directory
This commit is contained in:
commit
b61e261a16
@ -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
|
@ -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()
|
Loading…
Reference in New Issue
Block a user