What is the correct way to change the config of a new Gerrit project? - gerrit

I have multiple projects that I need to create under Gerrit (I am owner/root).
My gerrit location is /home/gerrit/
The first project was created under /home/gerrit/review_site/.
(pointing to git repo in /var/www/gitrepos)
When I create a second project from the Gerrit Web interface (Create Project link), I inherit the All-Projects project --
I think from (review_site/etc/gerrit.config).
It gives me a choice to inherit from another project, but there is no relevant parent project, as this second project has different options mostly (different groups, etc.).
I don't see any way to configure options during the Create Project step.
Once the project is created, I see that it shares the /home/gerrit/review_site/ folder (and so shares logs, etc.)
What is the best way to change the new project's config? I can clone the git repo, upload the changes through Gerrit. But can I change the directory and other details from under it?
Which config file should it use and how do I specify it? Do I need to restart the Gerrit server as the config file will then be changed? At the moment, I'm not sure what the architecture should be:
- should each project be in a different directory? (/home/gerrit/project1, /home/gerrit/project2, ...?)
Any help wrt how to manage separate projects in Gerrit would be appreciated.

You can't associate different "gerrit.config" configurations for different projects (repositories). The GERRIT-SITE/etc/gerrit.config file is a unique configuration file for the Gerrit server not for a specific project. These are the project options you can set.
The local filesystem directory where the Git repositories are created is configurated using the gerrit.basePath option in the GERRIT-SITE/etc/gerrit.config file. See more info here.

Related

Changing repository in a codeship project

I have created a project in Codeship using a repository from github. When i try to change it to a bitbucket repository, I get the following error.Image
Unfortunately it's currently not possible to switch providers for a Codeship project via the UI. You can either create a new project connected to the Bitbucket repository and copy over the settings or get in touch via https://helpdesk.codeship.com and we can make that change for you.
Here is the response from support executive
Unfortunately, it is not possible to change the source repository to
another SCM. It needs to be created as a new project.
You can add it as a new project and then copy over the setup and test
steps from the old project. You can then remove the old project when
ready under Project Settings > General.

VSO How to build a single solution in a Repository containing multiple

We are using Visual Studio Team Services as our source repository and for Build and Release.
What I Want to do?
We have a Repository that contains multiple directories in its root, each folder representing an ASP.NET Web Application. I want to use the Build feature to build a single solution in that repository.
The Problem
I can see the Build Agent downloading all source files for all folders/solutions in the Repository rather than just the solution I have selected.
Can someone provide the steps I need to take in order to only build one of the Solutions?
Thanks
The source Directory wasn't mapped correctly, hence was downloading all sources from the Repository root. Set this correctly and all is working well, with the a slight amendment to the Drop directory

Renaming a Jenkins Job

I have renamed a Jenkins Job from the Jenkins GUI. I changed the Project name in the Configure menu and hitting Save afterwards.
However the workspace name for this Jenkins job has not been changed. What I am finding is upon the job execution a new workspace is getting created with this given new name and none of the contents of the old workspace is getting copied.
So the issue is contents of the old workspace is not copied to the new workspace.
What should I do instead?
I know there are several questions in SO in this area. However those do not answer my question.
Renaming job in jenkins/hudson
Rename a job in Jenkins
So please check this before marking this question as a duplicate.
I was able to workaround this is issue using the Use custom workspace option.
To change this location, I need to choose configure job and click on the Advanced button in the Advanced Project Options section.
After opening the settings, you will find some more configuration options for your job. Look for the Use custom workspace option on the right hand side and check the box.
Reference: Jenkins: Change Workspaces and Build Directory Locations
Workspaces are volatile by nature and may reside on a build node which has gone offline, therefore your build job should not rely on files being present in the workspace. However sometimes you will benefit from a speed-up by reusing unchanged files existing in workspace and decide not to clean them.
When you start a build, a new workspace is (as you noted) created, this is the correct behaviour, you should not need to store files in your workspace between builds but set up your system to load all sources from your vcs. This way you will always be able to make a fresh build from source, there are also a few options available to clear the workspace from old files.
If you do not want to populate the workspace from a source code addon you can always use the custom shell script feature to run a few shell commands to copy the needed files.

Jenkins userContent files

We have a Jenkins master-slave model. Each job that is being run on slaves require a certain amount of configuration files. These files must be copied from master to each slave before the build step. So far I have been able to accomplish this with the Config File Provider Plugin. The drawback of this plugin is that it doesn't support folders, I would like to be able to put the configuration files for slave1 in the folder slave1 and so on. Now I have a huge list of files in the dropdown menu when creating a job and asked to provide configuration files.
This plugin comes with something handy: the configuration files can be edited via the web interface.
On the other hand Jenkins provides a userContent folder on the master accessible via http://[jenkins-server]/userContent that resolves my need for folders, but I haven't found a way to edit these files from the provided web interface.
I must mention that the master is a remote machine and I don't want to connect to it everytime I need to modify a file there. Is there any way to edit the files in the userContent folder, or to organize the files uploaded to the Config File Plugin into folders?
Thanks!
If possible put all the configuration into your SCM system and allow Jenkins to fetch them when needed/as they change.
Then your configuration files are managed just like your source code. As a bonus you can add a new node easily and developers can access and use they configuration files to test their build.
Supporting evidence:
Martin Fowler
Andrew Binstock
Darryl Bowler
If you have environment specific config files you can either load all of the individual config files into into your SCM system (this becomes unmanageable if you have a lot). Alternatively you can still store them in your SCM system and then do some combination of scripting with Jenkins parameters to update them on the fly.

How can I push to bitbucket.org without my project parent directory

I had created a remote repo with bitbucket.org, for example, https://somebody#bitbucket.org/somebody/test.git
When I pushed my local repo to the bitbucket repo by Eclipse EGit, I got all my project files in a parent directory, for example, https://somebody#bitbucket.org/somebody/test.git/Test/XXX. But I only hoped all my project files located in the repo root, for example, https://somebody#bitbucket.org/somebody/test.git/XXXX.
How can I do? Thanks!
eGit converts eclipse project into a folder under your Git repo when you 'share' it. This is the way eGit works, so I don't think what you asking is possible with eGit.
It is better this way IMO because such design allows for several projects in the same Git repository, which is very common.

Resources