Team for Capella embeds a Jenkins server as a scheduler.
The version shipped in Team for Capella is Jenkins LTS 2.150.1.
The full Jenkins documentation can be found at the following address: https://jenkins.io/doc/
By default it is available on the port 8036: when logged on the computer running the Scheduler, type the following address in a web browser:
Many jobs are built-in, already configured and organized in views: "Server Management", "Backup and Restore", "Diagnostic and Repair" and "Templates". By default, for all jobs, the last 100 job executions (called “builds” in Jenkins) results are kept by Jenkins (build’s artifacts and logs). Note that all these jobs can be changed with the Jenkins application.
The default view is the “Server Management” one.
This job starts the server. It never stops (and must not be aborted) except if “Server - Stop” is launched.
This job stops the server.
This job lists :
This jobs stores the credentials that are used by the Importer. As credentials needs to be associated with a repository, when this job is executed it will start by asking to fill the following parameters:
Note that credentials are required only with the Connected import strategy. See Importer strategies for more details.
This jobs is the opposite of the previous one, it clears the stored credentials that are used by the Importer. As credentials are associated with a repository, when this job is executed it will start by asking to fill the following parameters:
Note that credentials are required only with the Connected import strategy. See Importer strategies for more details.
This job is only present in the commercial versions of Team for Capella.
It allows to manage the license server directly from the Scheduler. It is disabled by default.
This job does a dump of the database into a zip file and keep it as an artefact of the build.
Note that this job will perform a backup of the whole server. If several repositories are started, it creates one zip file per repository.
We strongly recommend to have one database path per repository. See How to Add a New Repository
This job is intended to restore the database from a previously backed up database.
The backup folder is a result of the "Database - Backup" job.
If you want to restore only one repository, move all other archives out of the backup folder to keep the one specific to your repository.
It executes the importer application to import projects automatically from a server without any user interaction and archives them as Job’s artifacts.
This job will import the projects for a specific repository. It needs to be configured to specify the repository and optionally, a specific project list to import.
This job is by default configured to use the Snapshot import strategy. Refer to the Importer strategies documentation for more details.
If the job fails, you may have corrupted data in your database that could prevent you to get imported projects. Then you could have data loss if one day you really need those imported projects. In that case, you may:
This jobs extracts the user profile model from the database and saves it locally in the archiveFolder.
It is disabled by default and must be enabled only if the repository is configured to use the "User Profiles" access control mode.
This maintenance job needs to be manually launched. This job runs a diagnostic in order to detect inconsistencies described in Server Administration / Administration Tools / Repository maintenance application.
The diagnostic result is logged in the console output of the job. It is kept as an artifact of the job result.
The diagnostic is run for a specific repository and need to be configured according to your repository name.
This maintenance job needs to be manually launched. It is recommended to launch the Repository - diagnostic job first.
It runs a diagnostic in order to detect inconsistencies described in Server Administration / Administration Tools / Repository maintenance application. Then it launches the maintenance tasks if some managed issues are detected: it will backup the server with capella_db command, perform the required changes on the database and close the server. The steps are logged in the console output of the job and the corresponding log file is kept as an artifact of the job result.
The maintenance is run for a specific repository and need to be configured according to your repository name.
This view contains templates of jobs which are disabled by default.
See each job description in the Scheduler to see how to use them.
There are two ways to start the Scheduler: as a classic process or as a Windows service.
Launch /scheduler/scheduler.bat to start the scheduler as a classic process.
Once scheduler.bat file has been launched, the following command dialog should be raised :
If the Scheduler was launched as a classic process (scheduler.bat), just stop the process (the opened command dialog can be closed).
Launch
/scheduler/winservice.bat to install the service "TeamForCapellaScheduler",
then open Windows service management application
Start > run > "services.msc"
, the service should be visible
Menu > Properties on it , the service configuration dialog is shown
Set the "Startup type:" parameter to "Automatic" (making the service start with the computer).
In the "Log On" tab, configure the Windows account that will run the service. This account must have correct access rights to allow the Scheduler and the Team For Capella Server to access their data files.
If needed, start the service.
Note : /scheduler/jenkins_home/jenkins.xml file contains the definition of the service.
By default in the scheduler, the security checks are disabled. This means:
To enable these security checks, users can use the option "Configure Global Security" as follows:
It is possible to configure security within Jenkins in order to define a group of users, which are allowed to log in to Jenkins or to check user passwords against the username in LDAP. To do that, the procedure is the following:
You can also decide to use the Jenkins' own user database:
More details can be found in https://jenkins.io/doc/book/system-administration/security/ .
java -Djava.io.tmpdir=%JENKINS_HOME%\temp -Djenkins.install.runSetupWizard=false -jar %JENKINS_HOME%/jenkins.war --webroot=%JENKINS_HOME%/war --httpPort=8036 --extractedFilesFolder=%JENKINS_HOME%\temp
--httpPort=$HTTP_PORT Runs Jenkins listener on port $HTTP_PORT (being the port you want Jenkins to run on) using standard http protocol. The default is port 8080.
Ex:
--httpPort=8036 to access the scheduler admin page using http://hostname_of_teamforcapella_server:8036
--httpPort=8080 to access the scheduler admin page using http://hostname_of_teamforcapella_server:8080
<executable>java</executable>
<arguments>-Xrs -Xmx256m -Djava.io.tmpdir=%JENKINS_HOME%\temp -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8036 --webroot="%BASE%\war" --extractedFilesFolder="%JENKINS_HOME%\temp"</arguments>
I have 2 modeling projects (or more) working with Team for Capella and I want to isolate them in Jenkins (a person logged in Jenkins must see only Jenkins jobs dedicated to its project).
The proposed solution uses the internal Jenkins user database but is applicable with some changes to use a LDAP server.
Note that this section be adapted for different situations: multiple projects, multiple repositories or even multiple servers managed yby the same Scheduler.
When Jenkins is started for the first time, it contains all necessary jobs:
Let’s say the “Projects – Import“ job will be used for Project 1. So, rename it to “Project 1 – Import“:
Now we will create jobs for Project 2 (click on the “Jenkins” tab, “New Job” and select “Copy existing Job”). Copy the “Project 1 - Import“ job and rename it into “Project 2 - Import“. The result is the following:
|
Project 1 and Project 2 jobs have to be configured correctly to be used (their build step must be modified to add -projectName ProjectXName) and number of executors has to be increased. |
Go to “Manage Jenkins” / “Configure Global Security”, set parameters as shown in the screenshot:
Do the following changes in the table:
The table must be as follows:
Click on “Save”.
Access rights are now activated:
Create the “SuperAdmin” account and use it to log in Jenkins.
Go to the “Configuration” page of a job dedicated to Project 1 and check “Enable project-based security”:
Do the following changes in the table:
Do the same work on all jobs linked to Project1.
Repeat all above actions with “Project2Admin” and all jobs linked to Project2.
An admin/user dedicated to a project will not be allowed to see information on jobs of other projects.
For example, when logged as Project2Admin and with Project1’s server running. Project2Admin will see:
The Team for Capella scheduler (Jenkins) can be configured for a maximum number of build processes that can execute concurrently.
In order to ensure the correct operation of all Team for Capella server jobs it is vital to set this maximum number of build processes correctly!
For example, if the server machine is to run 5 Team for Capella server processes, then the value of # of executors would need to be set to 6 .
WARNING: setting this configuration parameter incorrectly can lead to complete system hangs, no Capella backups, etc!
Each Team for Capella server process relies on two network ports - a server port and a console port. In order to avoid confusion by using "magic" numbers for the ports within the scheduler jobs, it is best to create environment variables for these.
Note: the hyphen character is not allowed within the names of environment variables. Therefore, in the above example, although the repository names is test-01, within the environment variable name the hyphen is replaced by an underscore, i.e. Test_01
cd %TEAMFORCAPELLA_APP_HOME%/capella/eclipse command.bat -consoleLog localhost %CAPELLA_TEAM_CONSOLE_PORT_TEST_01% cdo stopserver
del *-sql.zip cd %TEAMFORCAPELLA_APP_HOME%/capella/eclipse command.bat -consoleLog localhost %CAPELLA_TEAM_CONSOLE_PORT_TEST_01% capella_db backup '%WORKSPACE%'
del *.zip del *.txt del *.activitymetadata rd /s /q importer-workspace cd %TEAMFORCAPELLA_APP_HOME%/capella/eclipse importer.bat -data "%WORKSPACE%/importer-workspace" -archivefolder "%WORKSPACE%" -closeserveronfailure true -checksize 5 -importCommitHistoryAsText -port %CAPELLA_TEAM_CONSOLE_PORT_TEST_01% -consoleport %CAPELLA_TEAM_CONSOLE_PORT_TEST_01% -repoName TEST_01
By default Jenkins will be launched using the java executable found in Windows\System. If the java version from this java executable is different from the key Java Runtime Environment\CurrentVersion in the registry, the service cannot be installed. If this problem is encountered, there are 2 solutions: