Fork project gitlab - spring

I am trying to get a copy of project from specific subgroup and create new project with this copy in another subgroup under the same group.
note:- I suppose to know the path for the target project to be created from variables I will get from database so I cannot use subgroup id directly.
var project = gitLabApi.getGroupApi().getGroup("parent-group/subgroup1/sub2/sub3/lastSubgroup").getProjects().get(0);
Here I got the project correctly.
my issue with copying it in another subgroup path
gitLabApi.getProjectApi().createProject("testname",gitLabApi.getGroupApi().getGroup("parent-group/targetsubgroup1/targetsub2/../targetlastSubgroup").getPath()).setForkedFromProject(project);
It runs the command but I cannot see any forked project created.
when I add the path as string path I get validation error in path.
Itried also
Project newProject = gitLabApi.getProjectApi().forkProject(project.getId(),gitLabApi.getGroupApi().getGroup("parent-group/targetsubgroup1/targetsub2/../targetlastSubgroup").getProjects().get(0).getNamespace().getName(),gitLabApi.getGroupApi().getGroup("parent-group/targetsubgroup1/targetsub2/../targetlastSubgroup","projnameSara");
I got 404 not found namespace

I find the solution for my issue.
first you have to make sure that the user you use in Gitlab has a maintainer permission.
then I got the project as I want from group or from project path with var called "project".
then used gitLabApi.getProjectApi().forkProject(project.getId(),gitLabApi.getGroupApi().getGroup("parentGroup/subgroup1/subgroup2/lastSubgroup").getId().toString(),"testFromPortal","testFromPortal");
notice that "testFromPortal" is refering to path and name for forked project.

Related

premake5 variable name for workspace and project

I wanted to make the process of creating premake5 file easier by automating the process of creating a premake5 file. when I tried to put a variable ProjectName = "myProject" into where the name of the workspace was supposed to be workspace ProjectName. it gave me an error. I also put it into the project and the location of the project but that doesn't work either project ProjectName, location ProjectName. I wonder if there is a way I can do this. thank you.
to achieve this, you simply just need to put a bracket around the name variable ProjectName like this workspace (ProjectName)! today, I just came back to the script and start experimenting and it works!

Team city template missing

I was going to reuse teamcity configuration to new environments. Looks like the configuration is based on a template, but actually there is no clickable link to teamplate and I can't find it in the root project. I was thinking that the template was deleted but team city doen't allow to remove templates which are used at least in one configuration
Could you advice why how is it possible to reach and reuse the template?
According to the sanpshot you pasted, your template is created in the root project. If you don't get a clickable link , you probably don;t have access to the root project
If you do have access to create target, you can copy the target to a new target. Templated settings are preserved when you copy over targets. You just need t change the target variables and if required any triggers or dependencies

How can I copy additional files to drop location with MsBuild 2013

I'm part of a large developmentteam with a big project that is built with TFS 2013. We have gotten the build to work with automatic tests and web transformations as well as deployment to correct folders. The last part we need is a way to copy additional files to the drop location with regards to different environment.
We have a folder in the solution that contains several deployment files for different environments. We build for several environment with each build.
The folder looks like the following:
A folder named contains several powershell scriptfiles
(Deploy.ps1, RunDeploy.ps1, StartService.ps1)
The first file should be copied to the root of the drop folder location for each configuration/environment.
The last two files should be copied to a new folder named Deploy under each configuration in the drop folder.
Additional to this we have several settings files in the same sourcefolder. One file for each environment named settings-.txt
These files should be copied to the Deploy folder for the correct configuration under the drop location.
We are using TFS 2013 so preferable using a custom workflow but we can use a target-file if needed.
Any idea how this can be created?
Where should I start?
I have been unable to locate a variable in a custom task in the build process that contains the location of the dropfolder for each configuration.
I managed to create a custom task in the build template after some searching for the variables I finally could create a custom task that created the correct folders and located the files that needed to be brought along in the build.
To find the variables I used the common task GetEnvironmentVariable with the specified variables. To see what each variable contained I added a print line just afterwards and tried the build and then when I had found the needed sources of information the task to create a custom build task was fairly easy.

Spring custom namespaces with Maven

I wrote my own custom namespace for a Spring based project I'm working on. The project is built with maven, and I'd like to put my xsd files in the resources directory. The problem is the spring.schemas directory requires me to define where I put my xsd file. In my dev environment it will be resources/schemas/myschema.xsd. But, when I compile, the contents of the resources get copied to target, not the target directory itself. So in the compiled code, I end up with target/schemas/myschema.xsd. Should my spring.schemas file reference resources/schemas/myschema.xsd? Or just schemas/xsd?
thanks,
Jeff
When creating a custom namespace for Spring the spring.schemas file should be located in META-INF with an entry like this:
http://www.springframework.org/schema/context/spring-context-2.5.xsd=org/springframework/context/config/spring-context-2.5.xsd
Your custom schema should be then in src/main/resources/org/springframework/context/config/ to be added in the classpath of the project.
Any good IDE should understand src/main/resources/ as a source code folder and read the schema just well.
NOTE: I pulled this example from the spring-core.jar, just examine it yourself
It should only point to schemas/myschema.xsd
target/resources will end up in your classpath so you can safely reference everything there.
You can define a linked location in Eclipse. By using a variable to define your workspace root and then creating a linked folder you maintain some measure of portability.
Right-click on the project, select new->Folder
call the folder "schemas", click Advanced>>, select Link to folder in the file system
Select Variables... and pick the WORKSPACE_ROOT variable
Add the relative path to your schemas folder, e.g. [project name]/src/main/resources/schemas
When you finish you'll have a new schemas folder with a little arrow in the corner showing it is linked. You may find you need to force refreshes to get new files to be reflected in the linked location.

Add reference DLL issue in Visual Studio

I am using VSTS 2008. I have two projects (both are written in C#) in one solution file. Project 1 depends on the output (DLL2) of project 2. So, in project 1, I am using "References --> Add Reference --> Browse", then find and select the DLL2 generated by project 2.
My question is, I am not sure whether using such method to add reference will result in some my local computer specific file path dependencies? In more details, suppose both of projects are located in folder d:\testprojectsolution (d:\testprojectsolution\project1 and d:\testprojectsolution\project2), I want to make sure that if I copy the whole solution folder d:\testprojectsolution (with the same structures of project1/project2) to other people under different location (e.g. c:\my documents\sampleprpjects\projects), they could build successfully (not dependent on any specific file path on my local machine, for example, no need to find files under d:\testprojectsolution\project2 or something).
If my approach to add reference dependencies could result in some specific file path dependencies, please let me know how to solve this issue. :-)
thanks in advance,
George
Instead of adding the reference using Browse, add it using Projects tab. It'll automatically consider the project dependency (and thus build order) and other stuff.

Resources