How to create a new project

This guide explains how to create a new GitLab project, link this project to the Teamcity build-server via Rundeck.

GiLab Sub Groups

This can all be done without having to rely on the ISG if the sub-groups fo your organisation or association is present within GitLab! If not, get in contact with with the ISG team via a service request ticket.

Create a GitLab project

You can create a GitLab project via GitLab yourself. You can find the GitLab documentation on this here. We will try to provide SIP sample projects in the VSETH core programming languages. Currently no sample projects are available.

Be sure to create the GitLab project in the correct subgroup. If you are unsure, see this flowchart.

After creation you should protect the master branch

Protect a MasterBranch
Prerequisite:

You must have at least the Maintainer role.

To protect a branch:v.
Go to your project and select Settings > Repository.
	Expand Protected branches.

	From the Branch dropdown list, select the branch you want to protect.
		Menu: Protect a branch
		-- Branch: main
		-- Allow to merge: Maintainers
		-- Allow to push: Developers + Maintainers

Select Protect

Link a project to Teamcity

To finally deploy your application on the SIP, you need to link your project to Teamcity. This task is done by a Rundeck job. Every developer in VSETH should have access to this job. 

  1. Open https://rundeck.vseth.ethz.ch and log in via SWITCH AAI
  2. Open the Rundeck project GitLab. 
  3. You will find a Link GitLab project to Teamcity job. Click on this job and enter the path to your project, for example: vseth/0403-isg/apis/peopleapi. Run this job by clicking the play symbol.

You just linked your project to Teamcity, but you may still not be able to access it. The reason for this is that you do not have the permission to view your build on Teamcity yet. See the next section for information on how to solve this.

Sync Gitlab permissions to Teamcity

The GitLab permissions are synced to Teamcity once a day via Rundeck, but you can also start this job manually:

  1. Open https://rundeck.vseth.ethz.ch and log in via SWITCH AAI
  2. Open the Rundeck project GitLab. 
  3. You will find a Sync GitLab permissions to Teamcity job. Click on this job and run it by clicking the play symbol.

Now you are ready to start developing! (Stern)