http://projects.andriylesyuk.com/http://projects.andriylesyuk.com/plugin_assets/andriy_lesyuk/images/s-andy.ico2011-10-19T14:03:30ZProjectsSCM Creator (+Github) - Feature #1870: Adding creation and deletion external script optionhttp://projects.andriylesyuk.com/issues/1870?journal_id=11102011-10-19T14:03:30ZJonas Götze
<ul></ul><p>+1<br />I was just searching for a way to achive this. In my case I would like to be able to select the post-commit-hook that will be copied for the newly created repository. If I could register such a creation script I could do that by having different creation-scripts available which copy the correct hooks and perhabs also do some other things (e.g. do a checkout of the project to /var/www/myProject for testing).</p>
<p>Also it would be nice if you could pass parameters to the scripts (e.g. a path to checkout to in /var/www). Perhabs you could use a textfield for the scriptpath and anything that follows the path will be passed as parameter... ?</p>
<p>Would be nice to have such a feature available!</p>
<p>Regards</p> SCM Creator (+Github) - Feature #1870: Adding creation and deletion external script optionhttp://projects.andriylesyuk.com/issues/1870?journal_id=11362011-10-22T09:35:04ZAndriy Lesyuks-andy@andriylesyuk.com
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Incomplete</i></li></ul><p>Thanks for the suggestion!</p>
<p>I guess it should be in <code>scm.yml</code>... (Why in Settings → Repository?)</p> SCM Creator (+Github) - Feature #1870: Adding creation and deletion external script optionhttp://projects.andriylesyuk.com/issues/1870?journal_id=11372011-10-22T09:35:24ZAndriy Lesyuks-andy@andriylesyuk.com
<ul><li><strong>Status</strong> changed from <i>Incomplete</i> to <i>Open</i></li></ul> SCM Creator (+Github) - Feature #1870: Adding creation and deletion external script optionhttp://projects.andriylesyuk.com/issues/1870?journal_id=11382011-10-22T09:35:35ZAndriy Lesyuks-andy@andriylesyuk.com
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Incomplete</i></li><li><strong>Target version</strong> set to <i>0.3.0</i></li></ul> SCM Creator (+Github) - Feature #1870: Adding creation and deletion external script optionhttp://projects.andriylesyuk.com/issues/1870?journal_id=11422011-10-24T11:59:22ZJonas Götze
<ul></ul><p>Andriy Lesyuk wrote:</p>
<blockquote>
<p>Thanks for the suggestion!</p>
</blockquote>
<p>Thanks for picking it up!</p>
<blockquote>
<p>I guess it should be in <code>scm.yml</code>... (Why in Settings → Repository?)</p>
</blockquote>
<p>Because you could select project-specific scripts or pass parameters to the script</p>
<p>Jonas Götze wrote:</p>
<blockquote>
<p>Also it would be nice if you could pass parameters to the scripts (e.g. a path to checkout to in /var/www). Perhabs you could use a textfield for the scriptpath and anything that follows the path will be passed as parameter... ?</p>
</blockquote>
<p>In my case I would need this, as we have at least 2 different project types, which need different commit-hooks. I could choose and copy the correct hook in my creation-script, but I would need some identifier (apart from projectname).<br />So it should be possible to either choose the fitting script on project-creation or pass a parameter to it which enables the script to decide correct.</p>
<p>Best would imo be if you could define some creation-/delete- scripts in scm.yml and these will be presented in a dropdown in Settings → Repository of the project along with an empty value for no script-execution at all.<br />The project creator would then be able to just choose one of the predefined scripts and create the repository.</p>
<p>What do you think?</p> SCM Creator (+Github) - Feature #1870: Adding creation and deletion external script optionhttp://projects.andriylesyuk.com/issues/1870?journal_id=11432011-10-24T16:19:24ZAndriy Lesyuks-andy@andriylesyuk.com
<ul><li><strong>Status</strong> changed from <i>Incomplete</i> to <i>Open</i></li></ul><p>Well... I like <code>scm.yml</code> option more because in this case I won’t need another database table just for storing selected scripts.</p>
<p>Which arguments do you want to have in these scripts?<br />They can be:<br /><pre>
$ /path/script $full_path_to_repo $project_identifier $repo_type
</pre></p>
<p>They can also be environment variables...</p>
<p>Jonas, what argument will be useful for you?</p> SCM Creator (+Github) - Feature #1870: Adding creation and deletion external script optionhttp://projects.andriylesyuk.com/issues/1870?journal_id=11442011-10-24T20:30:56ZBlaž Podržaj
<ul></ul><p>If we assume that repo name is the same as project identifier then we can use project identifier. Repo type can also help us in distingushing...</p> SCM Creator (+Github) - Feature #1870: Adding creation and deletion external script optionhttp://projects.andriylesyuk.com/issues/1870?journal_id=11522011-10-25T15:46:27ZJonas Götze
<ul></ul><p>Andriy Lesyuk wrote:</p>
<blockquote>
<p>Jonas, what argument will be useful for you?</p>
</blockquote>
<p>I guess only userdefined arguments will be...<br />Somewhat like a creation-Profilename whith that the creation-script can work as a dispatcher.<br />I doubt the project-name can always garantuee that, in our case at least.</p>
<p>Why would you need to store them in the database?<br />Create and delete a project (and repository) should only occur once I guess - so I think displaying the possible values in a dropdown or something else will happen once and then dissappear like the “create new Repository"-Button does.</p>
<p>Perhabs somthing like this:<br />scm.yml<br /><pre>
production:
auto_create: false
deny_delete: true
svn:
path: /var/lib/svn
svnadmin: /usr/bin/svnadmin
hooks: /usr/share/subversion/hook-scripts
url: svn
availablecreationscripts:
Script1: /usr/share/subversion/do-something-on-creation.sh
Script2: /usr/share/subversion/do-something-else-on-creation.sh
Script3: /usr/share/subversion/do-something-weird-on-creation.sh
</pre><br />Which will result in a dropdown with three options labeled with “Script1",“Script2",“Script3” and the corresponding values. I don’t know if this is a good way to realize this in your case - just as example.</p>
<p>If no scripts are defined the dropdown will not appear at all. If there are some scripts defined, there could (should?) also be the empty (default) option so you could still create a repository and use no script at all.</p>
<p>Regards</p> SCM Creator (+Github) - Feature #1870: Adding creation and deletion external script optionhttp://projects.andriylesyuk.com/issues/1870?journal_id=11532011-10-25T17:12:33ZAndriy Lesyuks-andy@andriylesyuk.com
<ul></ul><p>I don’t know why but I don’t like the idea of new select field... While it’s possible to show it on creation it can be impossible (or very hard) to show it on deletion... Anyway I will think about this.</p>
<p>Maybe some custom field value can help you? Is there anything that differs these two project types? Parent project?..</p> SCM Creator (+Github) - Feature #1870: Adding creation and deletion external script optionhttp://projects.andriylesyuk.com/issues/1870?journal_id=11542011-10-26T06:21:50ZBlaž Podržaj
<ul></ul><p>I thought this thing over and must agree that it should be only in scm.yml. The reason for this is because these are more like system settings which project admins aren’t really interested in (by definition they don’t even have access to the operating system) and they might get confused if they see such input/select fields in GUI that they know nothing about. So my vote is for:<br /><pre>
ceationscript: <script_path>
deletionscript: <script_path>
</pre>...in scm.yml only.</p> SCM Creator (+Github) - Feature #1870: Adding creation and deletion external script optionhttp://projects.andriylesyuk.com/issues/1870?journal_id=11552011-10-26T11:04:59ZAndriy Lesyuks-andy@andriylesyuk.com
<ul></ul><p>I believe the case described by Jonas is likely unusual... The plugin can’t cover all such cases! But I want to do as much as possible to help Jonas.</p>
<p>Jonas, what about this kind of solution (requires programming in script):</p>
<p>You can add a custom field e.g. “Project type” of “List” type having two possible values: e.g. “Type1” and “Type2”. Project managers will be required to select the “Project type” when creating a project. With this approach you will have a field which identifies your project types... And this field will be understandable to users unlike script names which can confuse. Having project identifier you can then fetch custom field value from database in your script... What do you think? I’m ready to help you implement such script if you agree.</p> SCM Creator (+Github) - Feature #1870: Adding creation and deletion external script optionhttp://projects.andriylesyuk.com/issues/1870?journal_id=11592011-10-27T07:22:35ZJonas Götze
<ul></ul><p>Andriy Lesyuk wrote:</p>
<blockquote>
<p>I believe the case described by Jonas is likely unusual... The plugin can’t cover all such cases! But I want to do as much as possible to help Jonas.</p>
</blockquote>
<p>Thanks a lot for that! I really appreciate it.</p>
<blockquote>
<p>Jonas, what about this kind of solution (requires programming in script):</p>
<p>You can add a custom field e.g. “Project type” of “List” type having two possible values: e.g. “Type1” and “Type2”. Project managers will be required to select the “Project type” when creating a project. With this approach you will have a field which identifies your project types... And this field will be understandable to users unlike script names which can confuse. Having project identifier you can then fetch custom field value from database in your script... What do you think? I’m ready to help you implement such script if you agree.</p>
</blockquote>
<p>Thanks for your offer - this suggestion sounds promising. I did not think of such a solution.<br />So in my creation script I would need to select the project-Record via mysql using the project identifier passed to the script - right?<br />I am new to shell-Scripts so I am not sure yet how I can use the result of the Query in the Script but I think I will figure this out. With that information I could then select the fitting commit-hooks and copy them to the passed project-Repository-Path and do everything else what is needed for the project type.</p>
<p>Thanks again for your efforts.</p>
<p>Regards</p> SCM Creator (+Github) - Feature #1870: Adding creation and deletion external script optionhttp://projects.andriylesyuk.com/issues/1870?journal_id=11742011-11-01T15:06:54ZAndriy Lesyuks-andy@andriylesyuk.com
<ul></ul><p>This option is going to replace <code>hooks</code> (see: <a class="issue tracker-3 status-5 priority-5 priority-default closed" title="Going to make hooks obsolete... Should I? (Closed)" href="http://projects.andriylesyuk.com/issues/1886">#1886</a>)! What do you think?</p> SCM Creator (+Github) - Feature #1870: Adding creation and deletion external script optionhttp://projects.andriylesyuk.com/issues/1870?journal_id=11792011-11-03T23:56:00ZAndriy Lesyuks-andy@andriylesyuk.com
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>In Progress</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>50</i></li></ul><p>Started!</p>
<p>New global config options: <code>pre_create</code>, <code>post_create</code>, <code>pre_delete</code> and <code>post_delete</code>...</p>
Scripts have three arguments:
<ul>
<li>path e.g. <code>/var/lib/git/download-button.git</code></li>
<li>type e.g. <code>git</code></li>
<li>identifier e.g. <code>download-button</code></li>
</ul>
<p>Specially for you, Jonas, script will have access to project custom fields! <span class="wiking smiley smiley-smiley" title=":)"></span> For example, if your custom field name is “Very specific type” there will be environment variable <code>SCM_CUSTOM_FIELD_VERY_SPECIFIC_TYPE</code>... <em>I believe many custom fields won’t harm scripts...</em></p> SCM Creator (+Github) - Feature #1870: Adding creation and deletion external script optionhttp://projects.andriylesyuk.com/issues/1870?journal_id=11822011-11-04T10:18:10ZAndriy Lesyuks-andy@andriylesyuk.com
<ul><li><strong>% Done</strong> changed from <i>50</i> to <i>80</i></li></ul> SCM Creator (+Github) - Feature #1870: Adding creation and deletion external script optionhttp://projects.andriylesyuk.com/issues/1870?journal_id=11852011-11-05T10:53:44ZAndriy Lesyuks-andy@andriylesyuk.com
<ul><li><strong>Due date</strong> set to <i>05 Nov 2011</i></li><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>80</i> to <i>100</i></li></ul><p>I believe the issue has been resolved! Thanks for your suggestions!</p> SCM Creator (+Github) - Feature #1870: Adding creation and deletion external script optionhttp://projects.andriylesyuk.com/issues/1870?journal_id=12032011-11-11T15:22:24ZJonas Götze
<ul></ul><p>Thanks for your work!</p>
<p>Andriy Lesyuk wrote:</p>
<blockquote>
<p>Specially for you, Jonas, script will have access to project custom fields! <span class="wiking smiley smiley-smiley" title=":)"></span> For example, if your custom field name is “Very specific type” there will be environment variable <code>SCM_CUSTOM_FIELD_VERY_SPECIFIC_TYPE</code>... <em>I believe many custom fields won’t harm scripts...</em></p>
</blockquote>
<p>This sounds very nice. I’ll try it as soon as I have some time again <span class="wiking smiley smiley-wink" title=";-)"></span> Thanks again!</p>
<p>Regards</p>