GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — vials_server/build.py at master · Caleydo/vials_server

This repository was archived by the owner on Jun 26, 2018. It is now read-only.

Expand file tree

/

build.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
51 lines (37 loc) · 1.39 KB
/

build.py

Copy path

File metadata and controls

51 lines (37 loc) · 1.39 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import shutil
from codecs import open
import json
__author__ = 'Samuel Gratzl'
def _git_head(cwd):
import subprocess
try:
output = subprocess.check_output(['git', 'rev-parse', '--verify', 'HEAD'], cwd=cwd)
return output.strip()
except subprocess.CalledProcessError:
return 'error'
def _resolve_plugin(repo, version):
import os.path
if os.path.isdir('.git') and repo:
if repo.endswith('.git'):
repo = repo[0:-4]
return repo + '/commit/' + _git_head('.')
# not a git repo
return version
def to_version(v):
import datetime
now = datetime.datetime.utcnow()
return v.replace('SNAPSHOT', now.strftime('%Y%m%d-%H%M%S'))
with open('package.json', 'r', encoding='utf-8') as f:
pkg = json.load(f)
name = pkg['name']
version = to_version(pkg['version'])
resolved = _resolve_plugin(pkg.get('repository', {}).get('url'), version)
# copy source code
shutil.rmtree('build/source/' + name, ignore_errors=True)
shutil.copytree(name, 'build/source/' + name, symlinks=False, ignore=shutil.ignore_patterns('*.pyc'))
# create buildInfo.json
build_info = dict(name=name, version=version, resolved=resolved, description=pkg['description'],
homepage=pkg.get('homepage'), repository=pkg.get('repository', {}).get('url'))
# TODO create build Info
with open('build/source/' + name + '/buildInfo.json', 'w', encoding='utf-8') as f:
json.dump(build_info, f, indent=2)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.