Skip to content

Commit

Permalink
Merge pull request #6 from ahmad88me/hard-reset
Browse files Browse the repository at this point in the history
Hard reset
  • Loading branch information
ahmad88me committed Apr 5, 2016
2 parents 985e014 + ac55017 commit 3bba5c4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ Collaborators: Daniel Garijo (@dgarijo), Ahmad Alobaid
![Image](../master/Jarsomatic Diagram.png?raw=true)


##How to use it
1. Add the url of the webhook.
2. Add jar.cfg.
3. After that, when ever you do a push to the master branch, if one of files you are watching is changed, then it will
be triggered and the command you specified will be called.


###JAR Configuration file:
There should a configuration file per monitored JAR (should be named jar.cfg)
```
[DEFAULT]
watch: "dir1/file1.owl", dir2/file2.csv
command: ls
```


###Jarsomatic Configuration file:
Expand All @@ -23,13 +37,6 @@ token: xxxxxxxxxxxxxxxxxx
```

###JAR Configuration file:
There should a configuration file per monitored JAR (should be named jar.cfg)
```
[DEFAULT]
watch: "dir1/file1.owl", dir2/file2.csv
command: ls
```

###Automatic deployment with Jarsomatic
To do so, the recommended way is to use access token
Expand Down
5 changes: 3 additions & 2 deletions jarsomatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ def update_fork(repo_str):
repo = g.get_repo(repo_str)
try:
# comm = "cd %s ; git config user.email 'jarsomatic@delicias.dia.fi.upm.es' ; git config user.name 'Jarsomatic' ; git branch ; git pull --no-edit -Xtheirs %s ; git add . ; git commit -m 'Jarsomatic update' ; git push "%(get_repo_abs_path(), repo.clone_url)
comm = "cd %s ; git config user.email 'jarsomatic@delicias.dia.fi.upm.es' ; git config user.name 'Jarsomatic' ; git branch ; git remote add upstream %s ; git pull --no-edit -Xtheirs upstream master ; git add . ; git commit -m 'Jarsomatic update' ; git push origin master "%(get_repo_abs_path(), repo.clone_url)
# comm = "cd %s ; git config user.email 'jarsomatic@delicias.dia.fi.upm.es' ; git config user.name 'Jarsomatic' ; git branch ; git remote add upstream %s ; git pull --no-edit -Xtheirs upstream master ; git add . ; git commit -m 'Jarsomatic update' ; git push origin master "%(get_repo_abs_path(), repo.clone_url)
comm = "cd %s ; git config user.email 'jarsomatic@delicias.dia.fi.upm.es' ; git config user.name 'Jarsomatic' ; git remote add upstream %s ; git pull upstream master ; git reset --hard upstream/master ; git add . ; git commit -m 'Jarsomatic update h' ; git push -f origin master "%(get_repo_abs_path(), repo.clone_url)
comm += append_comm
dolog("update fork command: %s"%(comm))
call(comm, shell=True)
Expand Down Expand Up @@ -347,7 +348,7 @@ def copy_repo():


def push_changes():
comm = "cd %s; git config user.email 'jarsomatic@delicias.dia.fi.upm.es' ; git config user.name 'Jarsomatic' ; git pull -s ours --no-edit origin gh-pages; git add . ; git commit -m 'jarsomatic update' ; git push origin gh-pages "%(get_repo_abs_path())
comm = "cd %s; git config user.email 'jarsomatic@delicias.dia.fi.upm.es' ; git config user.name 'Jarsomatic' ; git pull -s ours --no-edit upstream gh-pages; git add . ; git commit -m 'jarsomatic update p' ; git push -f origin gh-pages "%(get_repo_abs_path())
comm += append_comm
dolog("push changes command: %s"%(comm))
call(comm, shell=True)
Expand Down

0 comments on commit 3bba5c4

Please sign in to comment.