Scripting help.

21 views
Skip to first unread message

Daniel Lee

unread,
Apr 13, 2016, 10:51:30 PM4/13/16
to stan-dev mailing list
Hi all,

I could use your help with some scripting help.

When the math library's develop branch changes (github.com/stan-dev/math), I have Jenkins run a script to update the upstream project, Stan (github.com/stan-dev/stan). This is the current script: https://github.com/syclik/stan-scripts/blob/master/jenkins/create-stan-pull-request.sh

Here's the current flow. It starts when math's develop branch is changed.

0. (Local) Checkout stan-dev/stan and update to develop. Change directories into that directory.
1. (Local) Check to see if the math branch has actually changed. If not, don't do anything.
2. (GitHub) Create a github issue with title "Update submodule for the Stan Math Library". Save the issue number.
3. (Local) Create a new feature branch named feature/issue-#-update-math where # is the issue number.
4. (Local) Update the math submodule to develop. Stage the change to the submodule. Commit. Push to the remote.
5. (GitHub) Create a pull request with the feature branch.


What would be ideal is a check to see if an issue exists with the title "Update submodule for the Stan Math Library" it would then update the existing feature branch. No need to create a new pull request. Perhaps a new comment.

Help? I tried doing it, but I'm not that great at scripting.



Daniel



Ben Goodrich

unread,
Apr 14, 2016, 12:30:11 AM4/14/16
to stan development mailing list
On Wednesday, April 13, 2016 at 10:51:30 PM UTC-4, Daniel Lee wrote:
What would be ideal is a check to see if an issue exists with the title "Update submodule for the Stan Math Library" it would then update the existing feature branch. No need to create a new pull request. Perhaps a new comment.

curl -s https://api.github.com/repos/stan-dev/math/issues/${ISSUE} | \
grep
--quiet -F '"title": "Update submodule for the Stan Math Library"' && \
git commit
--allow-empty -m "This will have to wait on the refactoring"

Ben


Reply all
Reply to author
Forward
0 new messages