Skip to content

Commit

Permalink
[V3 Github] New info.json generator working with token
Browse files Browse the repository at this point in the history
  • Loading branch information
retke committed May 21, 2018
1 parent 9590d35 commit 235b8d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ install:
script:
- black --check -l 100 .
- python3 -m compileall .
- python3 info_deploy.py
- python3 info_deploy.py $GH_TOKEN $TRAVIS_BUILD_NUMBER
17 changes: 8 additions & 9 deletions info_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import os
import json
import sys

from instantcmd import InstantCommands
from roleinvite import RoleInvite
Expand Down Expand Up @@ -42,24 +43,22 @@ def create_info_json(instance, file_name):
file.close()


def commit():
def commit(token, build):
if os.popen("git diff").read() != "":
print(1)

os.system('git config user.name "Travis CI Auto-JSON"')
print(2)
os.system('git config user.email "travis@travis-ci.org"')
print(3)

os.system("git checkout v3")
print(4)
os.system("git add *.json")
print(5)

os.system('git commit -m "Updated info.json files"')
print(6)
os.system("git push")
os.system('git remote add github https://{}@github.com/retke/Laggrons-Dumb-Cogs.git')
os.system("git push github v3")


if __name__ == "__main__":
create_info_json(InstantCommands, "instantcmd")
create_info_json(RoleInvite, "roleinvite")
create_info_json(Say, "say")
commit()
commit(token=sys.argv[1], build=sys.argv[2])

0 comments on commit 235b8d3

Please sign in to comment.