Configuration of projects
In a JSON file, various settings can be made for projects to which baselines belong. The storage location of this project configuration file is configurable (see Baseline dog configuration).
The admin user is authorized to change the project configuration on the project page in the Baseline tool by clicking the 'Manage projects' button.
The configuration of each project is done as an array.
1. Example of a complete project configuration with two projects
The following example shows a complete project configuration with the two projects 'petclinic' and 'cas'.
The project petclinic
represents a project configuration with all optional attributes. In this project are for
additional SCM repositories, a Nexus artifact, and a Jenkins build log file for collecting baseline
are configured.
The cas
project reflects a simple project configuration in which a baseline consists of only a single
SCM tag.
[
{
"id": "petclinic",
"scm_url": "https://baseline.cloudogu.net/scm",
"full_qualified_repository_name": "baselineTest/spring-petclinic",
"additional_repository_names": [
"baselineTest/summer-petclinic",
"baselineTest/fall-petclinic",
"baselineTest/winter-petclinic"
],
"tag_regex": "^.*",
"nexus": {
"url": "https://baseline.cloudogu.net/nexus",
"nexus_artefacts": [
{
"repository": "maven-releases",
"name": "Petclinic JAR",
"location": "org/springframework/samples/spring-petclinic/${tag}/spring-petclinic-${tag}.jar"
}
]
},
"jenkins": {
"nexus_url": "https://baseline.cloudogu.net/nexus",
"repository": "maven-releases"
},
"app_version": "0.5.0-1"
},
{
"id": "cas",
"scm_url": "https://baseline.cloudogu.net/scm",
"full_qualified_repository_name": "baselineTest/cas",
"tag_regex": "^.*",
"app_version": "0.5.0-1"
}
]
2. Configuration of a single project
The individual configuration options of a single project are described in more detail below.
2.1 Configuration of the project ID
Each project has a unique ID. The ID of the project is also the name of the project. All configured projects are displayed in the project overview.
- Attribute key: 'id
- Data type: String
- Example:
"id": "petclinic"
2.2 Configuration of the SCM repositories
Settings for accessing the SCM manager must be configured for each project. Potential baselines are determined in the SCM Manager.
2.2.1 Configuring the SCM URL
In the project configuration file, the URL to the SCM manager where the configured repositories can be found must be must be specified.
- Attribute-Key:
scm-url
- Data type: String
- Example:
"scm_url": "https://ecosystem.cloudogu.com/scm"
2.2.2 Configuring the SCM repository with the potential baselines.
In the project configuration file, an SCM repository must be specified where the SCM tags of the potential baselines can be found. baselines can be found. When determining the potential baselines, this repository is searched for the tags, that match the configured tag pattern.
When collecting the elements of a baseline, the corresponding SCM tag is also collected and displayed in the baseline detail view under 'SCM Manager'.
The SCM repository must be specified with its namespace: <namespace>/<repository name>
.
- Attribute key:
full_qualified_repository_name
. - Data type: String
- Example:
full_qualified_repository_name
:demo/spring-petclinic
.
2.2.3 Configuring additional SCM repositories for collecting SCM tags.
For collecting baseline elements, it is optionally possible to specify additional SCM repositories. When collecting the baseline elements, these repositories are then also taken into account. In these repositories, SCM tags with the same name as the the same name as the baseline. The tags that are collected from the repositories configured here will be displayed in the baseline detail view under 'SCM Manager'.
The SCM repositories must each be specified with namespace: <namespace>/<repository name>
.
- Attribute key:
additional_repository_names
. - Data type: Array with strings
- Optional
- Example:
"additional_repository_names": [
"demo/spring-petclinic-clone",
"demo/spring-petclinic-additionals"
]
2.2.4 Configuration of the pattern for the SCM tags
In the project configuration file a pattern (regular expression) must be specified for the SCM tags to be considered. be specified. When determining the potential baselines, only those tags are considered that correspond to the configured pattern.
- Attribute Key:
- Data type: String
- Example:
"tag_regex":"^.*"
2.3Configuration for collecting artifacts from nexus.
For collecting additional baseline elements, it is optionally possible to configure a nexus with one or more artifacts to be collected. artifacts to be collected. When collecting baseline elements, these artifacts will then be included. The artifacts collected artifacts are displayed in the baseline detail view under 'Nexus'.
The configuration is done under the item "nexus": { ... }
- Attribute-Key:
nexus
- Data type: Struct
- Optional
- Example:
"nexus": {
"url": "https://baseline.cloudogu.net/nexus",
"nexus_artefacts": [
{
"repository": "maven-releases",
"name": "Petclinic JAR",
"location": "org/springframework/samples/spring-petclinic/${tag}/spring-petclinic-${tag}.jar"
}
]
}
2.3.1 Nexus URL configuration
If artifacts are to be collected from Nexus, the URL to the Nexus instance must be configured in the Nexus struct. be configured.
- Attribute key:
url
. - Data type: String
- Example:
"url": "https://baseline.cloudogu.net/nexus"
2.3.2 Nexus Artifact Configuration
One or more artifacts can be specified that will be collected from Nexus. The configuration of the artifacts is done as an array of Nexus artifact objects.
- Attribute Key:
nexus_artefacts
- Data type: array
- Example:
"nexus_artefacts": [
{
"repository": "maven-releases",
"name": "Petclinic JAR",
"location": "org/springframework/samples/spring-petclinic/${tag}/spring-petclinic-${tag}.jar"
}
]
2.3.2.1 Configuring a Nexus Artifact
To configure a Nexus artifact, the repository, name, and location of the artifact must be specified in the be specified.
2.3.2.2 Configuring the artifact repository.
The artifact repository specifies the repository where the specific artifact is searched.
- Attribute key:
repository
- Data type: String
- Example:
repository
:maven-releases
.
2.3.2.3 Configuration of the artifact name
The artifact name specifies the name under which the artifact is stored at the baseline.
- Attribute key:
name
- Data type: String
- Example:
name
:Petclinic JAR
.
2.3.2.4 Configuring the artifact location
The location specifies the name under which the artifact to be collected can be found. The location can use other values from the project configuration as placeholders.
- Attribute key: 'location'.
- Data type: String
- Example:
"location": "org/springframework/samples/spring-petclinic/${tag}/spring-petclinic-${tag}.jar"
.
2.4 Configuration to collect a Jenkins build log file
The Jenkins build log file is - contrary to what the name might suggest - not collected directly from Jenkins itself, but from Nexus. This is where the build log file is stored by Jenkins.
Specifically, during the Jenkins build, a step is provided via a Jenkins library, which is used to generate a so-called build report is generated. This extracts the information relevant to the build and loads it after deployment of the just generated artifact into the nexus.
When collecting the baseline elements, the Jenkins build log file in the jenkins
configured
Nexus repository for the Jenkins build log file (maven.extension=log
), which is determined based on the revision (commit ID)
of the baseline tag. The commit ID is the classifier
of the Maven dependency.
The configuration is done under the item "jenkins": { ... }
- Attribute-Key:
jenkins
- Data type: Struct
- Optional
- Example:
"jenkins": {
"nexus_url": "https://baseline.cloudogu.net/nexus",
"repository": "maven-releases"
},
2.4.1 Configuring a Nexus repository to collect the Jenkins build log file.
If a Jenkins build log file is to be collected from Nexus, the Jenkins struct must contain the URL to the Nexus instance and the repository must be configured.
2.4.1.1 Configuring the Nexus URL
The Nexus URL specifies the URL to the Nexus where the repository containing the Jenkins build log files is located.
- Attribute key:
nexus_url
. - Data type: String
- Example:
nexus_url
:https://baseline.cloudogu.net/nexus
.
2.4.1.2 Repository configuration
The repository specifies the repository to search for the Jenkins build log file.
- Attribute key:
repository
- Data type: String
- Example:
repository
:maven-releases
.
2.4.2 Example query to collect the Jenkins build log file.
The query sent from the baseline dogu to Nexus to collect the Jenkins build log file then looks like this, for example.
look like this:
https://baseline.cloudogu.net/nexus/service/rest/v1/search/assets?repository=maven-releases&maven.extension=log&maven.classifier=eb6b0757d6c24727417b417247f73805ad60c0e6
Explanation of how the URL is composed:
https://baseline.cloudogu.net/nexus
is the configurednexus_url
.repository=maven-releases
:maven-releases
is the configuredrepository
.maven.extension=log
indicates that this is a Maven artifact with the extensionlog
.maven.classifier=eb6b0757d6c24727417b417247f73805ad60c0e6
specifies the classifier of the Maven artifact.eb6b0757d6c24727417b417247f73805ad60c0e6
is the commit ID (revision) associated with the commit of the tag.
2.5 App version
In the text field for managing projects, an 'app_version' field is also displayed for each project. This value is written automatically by the system and is only required for internal technical details and cannot be changed. be changed.