Skip to content

Commit

Permalink
Auto update build time
Browse files Browse the repository at this point in the history
  • Loading branch information
jondy committed Jul 18, 2019
1 parent b707659 commit 3d0a607
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions platforms/make-hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
import json
import os

TEMPLATE = r'''sed -i -e '/"path": "{name}"/,+6 s/"sha256":.*$/"sha256": "{vdata}",/g' {filename}'''
from datetime import datetime


TEMPLATE = r'''sed -i -e '/"path": "{name}"/,+6 s/"sha256":.*$/"sha256": "{vdata}",/g' {filename}'''
UPDATE_TIME = r'''sed -i -e 's/"build_time": .*$/"build_time:": "{time}",/g' {filename}'''

def make_hash256(filename):
with open(filename) as f:
Expand All @@ -26,4 +29,10 @@ def make_hash256(filename):


if __name__ == '__main__':
make_hash256('index.json')
filename = 'index.json'
make_hash256(filename)

cmd = UPDATE_TIME.format(time=datetime.today().strftime('%Y-%m-%d %H:%M:%S'),
filename=filename)
print(cmd)
os.system(cmd)
2 changes: 1 addition & 1 deletion platforms/upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ done
# scp -i ~/.ssh/aliyun_id_rsa README.html $prefix/platforms.html

# Update hash of dynamic library
python make-hash.py
# python make-hash.py

echo "Upload index.json to $prefix/"
scp -i ~/.ssh/aliyun_id_rsa index.json $prefix/

0 comments on commit 3d0a607

Please sign in to comment.