From 3fba6d20d2058c33c7f5de39c45416f8bf26d918 Mon Sep 17 00:00:00 2001 From: Ahmad Alobaid Date: Fri, 1 Apr 2016 18:59:32 +0200 Subject: [PATCH 1/6] done --- jarsomatic.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jarsomatic.py b/jarsomatic.py index 0a0959e..8e062d5 100644 --- a/jarsomatic.py +++ b/jarsomatic.py @@ -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 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) @@ -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 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) From 0597a51714269ff27611764cf83f1d93029d42f8 Mon Sep 17 00:00:00 2001 From: Ahmad Alobaid Date: Fri, 1 Apr 2016 19:43:53 +0200 Subject: [PATCH 2/6] fix git reset --- jarsomatic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jarsomatic.py b/jarsomatic.py index 8e062d5..2ff39c5 100644 --- a/jarsomatic.py +++ b/jarsomatic.py @@ -271,7 +271,7 @@ def update_fork(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 remote add upstream %s ; 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 = "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) From eb12761566369459f3ef6c75bcfe066c0d9eebff Mon Sep 17 00:00:00 2001 From: Ahmad Alobaid Date: Fri, 1 Apr 2016 19:56:39 +0200 Subject: [PATCH 3/6] do a pull before the pull request --- jarsomatic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jarsomatic.py b/jarsomatic.py index 2ff39c5..cf26666 100644 --- a/jarsomatic.py +++ b/jarsomatic.py @@ -348,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 add . ; git commit -m 'jarsomatic update p' ; git push -f 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 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) From b5f56e1932cb93fcba051a6d355edaa618c61e4f Mon Sep 17 00:00:00 2001 From: Ahmad Alobaid Date: Fri, 1 Apr 2016 20:01:48 +0200 Subject: [PATCH 4/6] fix missing ; in git command --- jarsomatic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jarsomatic.py b/jarsomatic.py index cf26666..0380e61 100644 --- a/jarsomatic.py +++ b/jarsomatic.py @@ -348,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 git add . ; git commit -m 'jarsomatic update p' ; git push -f 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; 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) From d89fdb854d56a03bde6504184b5ddfb914d1fd12 Mon Sep 17 00:00:00 2001 From: Ahmad Alobaid Date: Fri, 1 Apr 2016 20:13:56 +0200 Subject: [PATCH 5/6] fix pull --- jarsomatic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jarsomatic.py b/jarsomatic.py index 0380e61..28f1e66 100644 --- a/jarsomatic.py +++ b/jarsomatic.py @@ -348,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; git add . ; git commit -m 'jarsomatic update p' ; git push -f 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) From ac5501753fc5c47464b6d5cddcff6c2bd1b60ea4 Mon Sep 17 00:00:00 2001 From: Ahmad Alobaid Date: Tue, 5 Apr 2016 15:33:57 +0200 Subject: [PATCH 6/6] update readme --- README.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 23f947a..0621aea 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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