Skip to content

Commit e0d51b9

Browse files
Added Travis CI
1 parent d98ae10 commit e0d51b9

File tree

6 files changed

+49
-156
lines changed

6 files changed

+49
-156
lines changed

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
language: python
2+
python:
3+
- "3.6"
4+
5+
# command to install dependencies
6+
install:
7+
- pip install -r .travis/requirements.txt
8+
# command to run tests
9+
script: python .travis/get_data.py
10+
after_script:
11+
- bash .travis/push.sh

.travis/get_data.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import urllib3.request, urllib.request
2+
import requests as req
3+
import os
4+
import json
5+
def repos():
6+
url = "https://api.github.com/orgs/codeclubtbms/repos"
7+
response = req.get(url, auth=(os.environ.get('GITHUB_USERNAME'), os.environ.get('GH_TOKEN')))
8+
print(response.text,file=open('assets/data/repos.json',"w"))
9+
10+
repos()

.travis/push.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
setup_git() {
3+
git config --global user.email "[email protected]"
4+
git config --global user.name "Travis CI"
5+
}
6+
7+
commit_website_files() {
8+
git add data/*.json
9+
git commit --message "[ci skip] Travis build: $TRAVIS_BUILD_NUMBER"
10+
}
11+
12+
upload_files() {
13+
git remote remove origin
14+
git remote add origin https://${GH_TOKEN}@github.com/codeclubtbms/codeclubtbms.github.io.git
15+
git push origin HEAD:master
16+
}
17+
18+
setup_git
19+
commit_website_files
20+
upload_files

.travis/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
urllib3
2+
requests
3+
simplejson

assets/js/main.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var EDGE_CONTRIBUTORS = '/stats/contributors',
22
EDGE_LANGUAGES = '/languages',
33
TOKEN = '0fd2b5dcefa201400f4376d0c7aa86d72f3ac5c8';
4-
4+
55
jQuery.fn.extend({
66
//Used to load featured team members in index.html
77
loadtopteam: function() {
@@ -33,11 +33,11 @@ jQuery.fn.extend({
3333
});
3434
$("#team .progress").addClass("hide");
3535
},
36-
//Used to load projects
36+
//Used to load projects
3737
loadprojects: function(loadAll) {
3838
var $container = $(this);
3939
$.ajax({
40-
url: 'https://codeclub.hackesta.org/api/github/orgs/codeclubtbms/repos?format=json',
40+
url: 'https://codeclub.hackesta.org/assets/data/repos.json',
4141
crossDomain: true,
4242
dataType: 'json',
4343
success: function(myData) {
@@ -84,7 +84,7 @@ jQuery.fn.extend({
8484
$("#projects .progress").addClass("hide");
8585
}
8686
});
87-
87+
8888
},
8989
loadallteam: function() {
9090
$container = this;
@@ -98,7 +98,7 @@ jQuery.fn.extend({
9898
$tr = $('<tr><td>' + val.name + '</td><td>' + val.joined_year + '</td><td>' + val.roles + '</td><td>' + sociallinks + '</td></tr>');
9999
$container.append($tr);
100100
});
101-
101+
102102

103103
});
104104

tree.html

Lines changed: 0 additions & 151 deletions
This file was deleted.

0 commit comments

Comments
 (0)