Skip to content

Commit

Permalink
Merge pull request #921 from kmehant/travis-fix-2
Browse files Browse the repository at this point in the history
Now build shows only errors and other logs are redirected
  • Loading branch information
JaDogg authored Jun 9, 2020
2 parents 9fca203 + aecf831 commit b7668b9
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 39 deletions.
36 changes: 18 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
dist: trusty
language: minimal
language: generic

sudo: required

services:
- docker

notifications:
webhooks: https://www.travisbuddy.com/

script:
- docker build --build-arg VCS_REF=`git rev-parse --short HEAD` --build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` -t scoreucsc/bassa-prod-ui ui
- docker build -f ui/Dockerfile.dev --build-arg VCS_REF=`git rev-parse --short HEAD` --build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` -t scoreucsc/bassa-dev-ui ui
- docker build -f components/core/Dockerfile.prod --build-arg VCS_REF=`git rev-parse --short HEAD` --build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` -t scoreucsc/bassa-prod-server components/core
- docker build --build-arg VCS_REF=`git rev-parse --short HEAD` --build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` -t scoreucsc/bassa-dev-server components/core
- docker build --build-arg VCS_REF=`git rev-parse --short HEAD` --build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` -t scoreucsc/bassa-aria2c components/aria2c


after_success:
- if [ "$TRAVIS_BRANCH" == "develop" -a "$TRAVIS_PULL_REQUEST" == "true" ]; then
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
docker push scoreucsc/bassa-prod-ui;
docker push scoreucsc/bassa-dev-ui;
docker push scoreucsc/bassa-prod-server;
docker push scoreucsc/bassa-dev-server
docker push scoreucsc/bassa-aria2c;
fi
script:
- docker build -t scoreucsc/bassa-ui:prod ui >/dev/null
- docker build -f ui/Dockerfile.dev -t scoreucsc/bassa-ui:dev ui >/dev/null
- docker build -f components/core/Dockerfile.prod -t scoreucsc/bassa-server:prod components/core >/dev/null
- docker build -t scoreucsc/bassa-server:dev components/core >/dev/null
- docker build -t scoreucsc/bassa-aria2c components/aria2c >/dev/null

deploy:
- provider: script
script: deploy.sh
on:
branch: master
- provider: script
script: deploy.sh
on:
branch: develop
3 changes: 2 additions & 1 deletion components/core/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ websocket-client==0.37
Werkzeug==0.11.4
SQLAlchemy==1.1.9
gunicorn==19.9.0
minio==5.0.5
minio==5.0.5
Flask==0.10.1
4 changes: 3 additions & 1 deletion components/core/routes/Download.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def kill():
token = request.headers['key']
if str(token) != SERVER_SECRET_KEY:
return "{'error':'not authorized'}", 403
if p is not None:
p = None
if len(processes) != 0:
p = processes[0]
p.terminate()
p.join()
jsonreq = json.dumps({'jsonrpc': '2.0', 'id': 'qwer', 'method': 'aria2.pauseAll'})
Expand Down
6 changes: 5 additions & 1 deletion components/core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ def read(file_name):

install_reqs = parse_requirements(requirements_path, session=False)

requirements = [str(ir.req) for ir in install_reqs]
try:
requirements = [str(ir.req) for ir in install_reqs]
except:
requirements = [str(ir.requirement) for ir in install_reqs]


### Set configs ###
if platform.system() == 'Linux':
Expand Down
39 changes: 39 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#! /bin/bash

# Build production and development use docker images
# Build these images with two build args for better commit history
# shows only logs pushed to stderr
# release tag should be updated here for every release

git_sha=$(git rev-parse --short HEAD)
build_date=$(date -u +”%Y-%m-%dT%H:%M:%SZ”)

docker build --build-arg VCS_REF=$git_sha --build-arg BUILD_DATE=$build_date -t scoreucsc/bassa-ui:prod -t scoreucsc/bassa-ui:latest -t scoreucsc/bassa-ui:v1.0.0 ui >/dev/null
docker build -f ui/Dockerfile.dev --build-arg VCS_REF=$git_sha --build-arg BUILD_DATE=$build_date -t scoreucsc/bassa-ui:dev ui >/dev/null
docker build -f components/core/Dockerfile.prod --build-arg VCS_REF=$git_sha --build-arg BUILD_DATE=$build_date -t scoreucsc/bassa-server:prod -t scoreucsc/bassa-server:latest -t scoreucsc/bassa-server:v1.0.0 components/core >/dev/null
docker build --build-arg VCS_REF=$git_sha --build-arg BUILD_DATE=$build_date -t scoreucsc/bassa-server:dev components/core >/dev/null
docker build --build-arg VCS_REF=$git_sha --build-arg BUILD_DATE=$build_date -t scoreucsc/bassa-aria2c:latest -t scoreucsc/bassa-aria2c:v1.0.0 components/aria2c >/dev/null

# push production docker images with tags prod, latest, release:v1.0.0
# push development docker images with tag dev
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"

# Production tag
docker push scoreucsc/bassa-ui:prod
docker push scoreucsc/bassa-server:prod

# Latest tag
docker push scoreucsc/bassa-ui:latest
docker push scoreucsc/bassa-server:latest
docker push scoreucsc/bassa-aria2c:latest

# v1.0.0 tag
docker push scoreucsc/bassa-ui:v1.0.0
docker push scoreucsc/bassa-server:v1.0.0
docker push scoreucsc/bassa-aria2c:v1.0.0

# Development tag
docker push scoreucsc/bassa-ui:dev
docker push scoreucsc/bassa-server:dev


3 changes: 2 additions & 1 deletion ui/src/app/views/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@ <h4>There are no pending signup requests!</h4>
</div>

<md-content class="block md-padding table-responsive-vertical" >
<!-- Minio
<md-content layout="row" layout-sm="column">
<md-subheader>View downloaded files</md-subheader>
<md-button class="md-raised md-primary" ng-click="visitMinio()">
Visit Minio
</md-button>
</md-content>

-->
<br>
<br>

Expand Down
37 changes: 20 additions & 17 deletions ui/src/app/views/table.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<md-button ng-show="isShowingCheckbox" ng-click="deselectAll()"><i class="material-icons ng-scope">check_circle_outline</i></md-button>
<md-button ng-show="isShowingCheckbox" ng-click="selectAll()"><i class="material-icons ng-scope">check_circle</i></md-button>
</div>
<table id="table" class="table table-hover table-bordered" ng-show="isGridVisible">
<table id="table" class="table table-hover table-bordered" ng-show="!isGridVisible">
<thead>
<tr>
<th>#</th>
Expand All @@ -28,6 +28,24 @@
</tr>
</tbody>
</table>

<ul>
<li class="li-grid" ng-repeat="download in downloads" ng-show="isGridVisible" ng-click="onFileItemClick()">
<md-card class="card-view">
<img ng-src="{{getImage(download.download_name)}}" class="md-card-image image-class" alt="image caption">
<md-card-content>
<div>
<p class="file-name">{{download.download_name}}</p>
</div>
</md-card-content>
<button class="md-raised md-primary md-button md-ink-ripple button-design" ng-click="compressFiles([download.gid])">
Download
</button>
<!-- please add checkbox here also -->
</md-card>
</li>
</ul>

</div>

<div ng-if="data.length == 0">
Expand All @@ -36,19 +54,4 @@ <h4>There are no completed downloads yet!</h4>
</md-content>
</div>

<ul>
<li class="li-grid" ng-repeat="download in downloads" ng-show="!isGridVisible" ng-click="onFileItemClick()">
<md-card class="card-view">
<img ng-src="{{getImage(download.download_name)}}" class="md-card-image image-class" alt="image caption">
<md-card-content>
<div>
<p class="file-name">{{download.download_name}}</p>
</div>
</md-card-content>
<button class="md-raised md-primary md-button md-ink-ripple button-design" ng-click="compressFiles([download.gid])">
Download
</button>
<!-- please add checkbox here also -->
</md-card>
</li>
</ul>

0 comments on commit b7668b9

Please sign in to comment.