forced checkin or checkout using NANT - cruisecontrol.net

Is there any way that NANT would do a force checkout from source control or force checkin even if there is newer version in source control?

I not an nant guy, but could you explain what is the purpose of it?
Forcing checkin automatically looks to me like a bad idea - if I modified file by mistake I don't want it to be automatically checking without my innervation.

If you were using a CruiseControl.NET source control block then you could specify cleanCopy="true" to delete the working copy before updating the source.

I assume you want to circumvent the normal CruiseControl.Net checkout mechanism? You will have to execute the source control command line yourself, or use something like NAntcontrib.
Please specify what source control engine are you using.

Related

Gitlab ci omnibus access rights

i have gitlab omnibus, 8.0.4 version, installed on private server, we need to remove access right from reporter to read/pull/download code,
so we dont want reporter to viewer the source code
I think it can be done through editing some file on the server, right?
how can we do it?
Reporter always has read access to files, issues and merge requests. This cannot be altered (and we do not recommend modifying source files since it makes upgrades more difficult).
My suggestion is to create a separate project with only the issue tracker enabled and add the user as a reporter there. Keep the project with source code private.
Danger section ;)
If you really want to modify the code, look in app/models/ability.rb. In the project_report_rules method remove the rights you do not wish 'reporter' to have.

Perforce client side pre-commit hook

We are using perforce as a source control for Visual studio solution.
Working with P4 and P4V.
Is it possible to add client side pre-commit hook? for instance to ensure the word "debugger;" is not exist in *.js files.
Could find something in Google.
Thanks.
Perforce triggers can be used to enforce such a policy, but they run in the server, not client-side. So most sites that I'm aware of would enforce a rule such as the one you describe using a change-content trigger in the server.
http://www.perforce.com/perforce/doc.current/manuals/cmdref/triggers.html
It's not obvious from your question why you need to have a client-side hook. Is there some reason you don't want to use a change-content trigger?
Perhaps you might consider re-framing your workflow as a code review process, and implement policies like this in your code review tool of choice.
One approach that you could use is a "Custom Tool":
https://www.perforce.com/perforce/doc.current/manuals/p4v/custom_tools.html
Basically you would write a script that takes the changelist as an arg checks your condition on every file in your changelist and calls p4 commit if it succeeds.
Use latest git-p4. My patch for the hook p4-pre-submit is merged into Git's next branch.
The hook is a simple executable script which will stop the submit process to start up if the script exist with non-zero status. So p4-pre-submit hook is pretty safe without any side effect.
See https://github.com/git/git/blob/next/Documentation/git-p4.txt for details.
Please note git-p4 is an independent python script. It's not dependent on any specific version of git. So you can upgrade git-p4 only.
The hook p4-pre-submit has no other interaction with git/git-p4 except exiting status. So you can write the hook in any language (I recommend python).
Here is sample .git/hooks/p4-pre-submit:
#!/bin/sh
cd $GIT_DIR && make test

In CruiseControl.net How can I publish only modified files?

I have a large web project and I would like to publish only the files that were modified by the last checkin. What would be the best way to do this?
I found an article that detailed the process using robocopy. I thought perhaps there was a task in ccnet that did this, but I couldn't find one.
http://msmvps.com/blogs/omar/archive/2008/10/06/asp-net-website-continuous-integration-deployment-using-cruisecontrol-net-subversion-msbuild-and-robocopy.aspx
It depends on what you are doing. Do you use a build script? Your best bet is to let your build script do your publishing, you will have much more control over it.
There is a Modification Writer Task that will create an XML file of the detected modifications in that build. You could then have your build script read that and publish just those files.
There is also a Modification Reader and the doc implies that you can use the read in modifications and publish based on that list:
The ModificationReaderTask can now easily read the modification
file(s) made by project one, into it's
own integration,
making it possible that these can be used by the existing
tasks/publishers of ccnet for project
2
However, it doesn't make it to obvious how you would do this. Perhaps the BuildPublisher will use the Modification Reader info. This might get you started.

Does CC.NET detect modification when a build script performs a checkin

I've been doing some research into finally automating our Development builds and still have one nagging question that I'm hoping the StackOverflow community can solve for me.
My understanding is that an IntervalTrigger when setup properly will check VSS every X seconds for changes and if it finds a modified file, will run my tasks. One of my tasks would be to checkout the AssemblyInfo files and update the version numbers. After these files are updated they would be checked back into VSS.
Thinking about this solution it doesn't make much sense because in my mind, I'm forcing the check for changed files to true every time the trigger fires. Am I missing something here? Is there a way of doing this without triggering an automatic build on the AssemblyInfo check-in?
You can use a Filtered Source Control Block to exclude certain files from the trigger.
I just posted a bunch about my default build process here which may be of some interest to you: SVN Website Development and Deployment Solution
The way I usually configure my projects with CC.NET is to have two project blocks per solution. One configured as an interval trigger that does nothing more than get the latest from my repository, build the solution, and run unit tests. The other is a schedule trigger that does all the things the other one does, but actually publishes a build. This includes changing version numbers, publishing files, etc. This might work in your case, since the change in version would cause the interval project to trigger, but only once.
Checking the automatically generated AssemblyInfo into the version control system is a bad idea, don't do it. You'll get a lot of noise (50% of all commits!) in your history. Also, it does not give you any new information - you can always pull this from VCS. Have your build script autogenerate those files is a good practice, but don't push those changes back!

CruiseControl.NET send mail with fix list on build?

I was wondering if it is possible if I could include a Fix List with my deployment build email notification,what I was expecting is I would add the latest changes to a text file stored in a directory and CruiseControl.NET would pick it from there and send along with the email.Anybody has any similar solutions, or how did you do it? Any samples or links?
Thanks in advance.
The first question is whether you do continuous integration (CI) builds or just periodical builds? In case it is CI, have you tried writing this fix list into the check-in comment of your version control system? CCNet shows this comment as part of the build report (and email notification).
UPDATE: the other option I see is to write your own CCNet plugin for this. It shouldn't be too hard. As a reference on writing CCNet plugins you can use my own BrekiLabeller plugin.

Resources