|
|
<table style="border-collapse: collapse; border: none;">
|
|
|
<tr style="border-collapse: collapse; border: none;">
|
|
|
<td style="border-collapse: collapse; border: none;">
|
|
|
<a href="http://www.openairinterface.org/">
|
|
|
<img src="../images/oai_final_logo.png" alt="" border=3 height=50 width=150>
|
|
|
</img>
|
|
|
</a>
|
|
|
</td>
|
|
|
<td style="border-collapse: collapse; border: none; vertical-align: center;">
|
|
|
<b><font size = "5">OAI eNB Continuous Integration Master Job Description</font></b>
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
|
|
|
## Table of Contents ##
|
|
|
|
|
|
|
|
|
# 1. Introduction #
|
|
|
|
|
|
Currently it is hosted on the CI Jenkins server on [this job/item](https://oailab.eurecom.fr:8083/jenkins/job/eNb-CI/).
|
|
|
|
|
|
A build is automatically triggered on this job by actions on the OAI eNB GitLab repository. See the [repository integrations page](https://gitlab.eurecom.fr/oai/openairinterface5g/settings/integrations) for more details.
|
|
|
|
|
|
The eNB-CI master job is configured to start when:
|
|
|
|
|
|
- a push is made to `develop` branch
|
|
|
- a merge-request to the `develop` branch is opened.
|
|
|
- when extra commits are pushed to the source branch of an already opened merge request
|
|
|
|
|
|
The last one allows developers to fix issues on their working branch when requested by CI administrator or integrators.
|
|
|
|
|
|
The eNB-CI master job may be configured without any parameter. In that case no social media notifications (such as Slack, Mattermost, ...) is performed.
|
|
|
|
|
|
At time of writing, the eNB-CI master job hosted at Eurecom is using the following parameters:
|
|
|
|
|
|
- **pipelineUsesSlack** : the master job will send notifications to OAI Slack workspace
|
|
|
- **RedHatRemoteServer**
|
|
|
- **RedHatRemoteCredentials**
|
|
|
- **RedHatWorkingPath** : temporaly CentOS build is done on a real server and not a virtual machine. These parameters will be removed once VM CentOS build is available.
|
|
|
|
|
|
# 2. Source Control of the Jenkins pipeline script #
|
|
|
|
|
|
**IMPORTANT: the Jenkins Declarative Pipeline script file is retrieved from Source Control Management (SCM) under GIT w/ the `develop` branch.**
|
|
|
|
|
|
**It means that a temporary clone of the openairinterface5g repository is made on the latest version of `develop` branch to retrieve one file: `ci-scripts/Jenkinsfile-gitlab`. This file will be loaded by the Jenkins master job and executed. During a Merge-Request, if modifications to this particular file are made, they WON'T taken into account.**
|
|
|
|
|
|
# 3. Declarative Pipeline Script #
|
|
|
|
|
|
The script is written in `Groovy`, a Java-derivative language, using the Declarative Pipeline syntax. It does not prevent us to use some Scripted Pipeline syntax elements when needed.
|
|
|
|
|
|
The first few blocks are written to:
|
|
|
|
|
|
- Specify the node to work on
|
|
|
- Specify some generic options such as timestamping, using AnsiColor, preparing the connection with the GitLab server.
|
|
|
- Using gitlabBuilds keyword with a set of stages sends a message to the GitLab server. The latter performs the following steps:
|
|
|
- Create a GitLab pipeline
|
|
|
- Associate this pipeline with the corresponding commit or Merge-Request that triggered the Jenkins job
|
|
|
- Associate this GitLab pipeline with the Jenkins master job
|
|
|
- Create an `external job` for each stage specified and put them in a `pending` stage.
|
|
|
|
|
|
## 3.1 Verify Parameter stage ##
|
|
|
|
|
|
In this stage we are verifying the parameters are consistent.
|
|
|
|
|
|
At the time of writing:
|
|
|
|
|
|
- Redhat - CentOS parameter check: if 3 needed parameters are present in the Jenkins Master job configuration, CentOS build will be performed on a remote CentOS server. If not, no CentOS build will be scheduled.
|
|
|
|