소스 검색

Merge pull request #58 from vmarkovtsev/master

Finish with the binary packages
Vadim Markovtsev 7 년 전
부모
커밋
e917c88f43
3개의 변경된 파일68개의 추가작업 그리고 31개의 파일을 삭제
  1. 52 9
      .travis.yml
  2. 9 9
      README.md
  3. 7 13
      requirements.txt

+ 52 - 9
.travis.yml

@@ -17,31 +17,34 @@ addons:
     - gcc-6
     - g++-6
 
+go_import_path: gopkg.in/src-d/hercules.v3
 go:
   - 1.8
   - 1.9
 
-go_import_path: gopkg.in/src-d/hercules.v3
+stages:
+  - test
+  - deploy
+
+env:
+  - PROTOC_VERSION=3.5.1
 
 before_install:
   - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90
   - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 90
-  - wget -O protoc.zip https://github.com/google/protobuf/releases/download/v3.5.0/protoc-3.5.0-linux-x86_64.zip
+  - wget -O protoc.zip https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-x86_64.zip
   - unzip -d ~/.local protoc.zip && rm protoc.zip
   - go get -v github.com/golang/lint/golint
-  - go get -v github.com/gogo/protobuf/protoc-gen-gogo
   - git clone --depth 1 https://github.com/src-d/go-git $GOPATH/src/gopkg.in/src-d/go-git.v4
   - wget https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py --user && rm get-pip.py
-  - docker run -d --privileged -p 9432:9432 --name bblfshd bblfsh/bblfshd
-  - docker exec -it bblfshd bblfshctl driver install --all
-  - export PATH=~/.local/bin:~/usr/bin:$PATH
+  - export PATH=~/usr/bin:$PATH
   - make --version
   - pip3 --version
   - pip3 install --user -r requirements.txt tensorflow
-
+  - docker run -d --privileged -p 9432:9432 --name bblfshd bblfsh/bblfshd
+  - docker exec -it bblfshd bblfshctl driver install --all
 install:
   - make
-  
 script:
   - go vet ./...
   - golint ./...
@@ -54,9 +57,49 @@ script:
   - (cd contrib/_plugin_example && make)
   - $GOPATH/bin/hercules --burndown --burndown-files --burndown-people --couples --quiet https://github.com/src-d/hercules | python3 labours.py -m all -o out --backend Agg --disable-projector
   - $GOPATH/bin/hercules --burndown --burndown-files --burndown-people --couples --quiet --pb https://github.com/src-d/hercules | python3 labours.py -f pb -m all -o out --backend Agg --disable-projector
-
 after_success:
   - bash <(curl -s https://codecov.io/bash)
 
+jobs:
+  include:
+    - stage: deploy
+      os: osx
+      go: 1.9
+      before_install:
+        - wget -O protoc.zip https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-osx-x86_64.zip
+        - unzip -d ~/.local protoc.zip && rm protoc.zip
+      after_success:
+        - gzip -S .darwin_amd64.gz $GOPATH/bin/hercules
+      script: skip
+      install:
+        - make
+      deploy:
+        provider: releases
+        api_key: $(GITHUB_TOKEN)
+        file: "hercules.darwin_amd64.gz"
+        skip_cleanup: true
+        on:
+          tags: true
+    - stage: deploy
+      os: linux
+      go: 1.9
+      before_install:
+        - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90
+        - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 90
+        - wget -O protoc.zip https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-x86_64.zip
+        - unzip -d ~/.local protoc.zip && rm protoc.zip
+      script: skip
+      install:
+        - make
+      after_success:
+        - gzip -S .linux_amd64.gz $GOPATH/bin/hercules
+      deploy:
+        provider: releases
+        api_key: $(GITHUB_TOKEN)
+        file: "hercules.linux_amd64.gz"
+        skip_cleanup: true
+        on:
+          tags: true
+
 notifications:
   email: false

+ 9 - 9
README.md

@@ -17,24 +17,24 @@ to merge several analysis results together. There is a [presentation](http://vma
 <p align="center">torvalds/linux line burndown (granularity 30, sampling 30, resampled by year). Generated with <code>hercules --burndown --pb https://github.com/torvalds/linux | python3 labours.py -f pb -m project</code></p>
 
 ### Installation
-You are going to need Go (>= v1.8) and Python 2 or 3.
+
+Grab `hercules` binary from the [Releases page](https://github.com/src-d/hercules/releases). `labours.py` requires the Python packages listed in [requirements.txt](requirements.txt):
+
 ```
-go get -d gopkg.in/src-d/hercules.v3/cmd/hercules
-cd $GOPATH/src/gopkg.in/src-d/hercules.v3/cmd/hercules
-make
+pip3 install -r requirements.txt
 ```
 
-#### Windows
-`hercules`: [bblfsh/client-go](https://github.com/bblfsh/client-go/blob/master/WINDOWS.md) is needed.
+Numpy and Scipy can be installed on Windows using http://www.lfd.uci.edu/~gohlke/pythonlibs/
 
+### Build from source
+You are going to need Go (>= v1.8) and Python 2 or 3.
 ```
 go get -d gopkg.in/src-d/hercules.v3/cmd/hercules
-cd %GOPATH%/src/gopkg.in/src-d/hercules.v3/cmd/hercules
+cd $GOPATH/src/gopkg.in/src-d/hercules.v3/cmd/hercules
 make
 ```
 
-`labours.py`: Numpy and SciPy are requirements. Install the correct version by downloading the wheel from http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy.
-Couples analysis also needs Tensorflow.
+Replace `$GOPATH` with `%GOPATH%` on Windows.
 
 ### Contributions
 

+ 7 - 13
requirements.txt

@@ -1,14 +1,8 @@
-args==0.1.0
-clint==0.5.1
-cycler==0.10.0
-matplotlib==2.0.2
-numpy==1.13.1
-pandas==0.20.3
-pyparsing==2.2.0
-python-dateutil==2.6.1
-pytz==2017.2
-PyYAML==3.12
-scipy==0.19.1
-six==1.10.0
-protobuf>=3.0.0
+clint>=0.5.1,<1.0
+matplotlib>=2.0,<3.0
+numpy>=1.13.1,<2.0
+pandas>=0.20.0,<1.0
+PyYAML>=3.12,<4.0
+scipy>=0.19.0,<2.0
+protobuf>=3.5.0,<4.0
 munch>=2.0