The ci-web instance hosts the CI-RT Web application. It needs access to the database which is filled with test results by CI-RT Jenkins.
If you like to develop code for CI-RT, please notice the content of the sections "License rules" and "Copyright notice".
The instance is a Debian stretch based system.
The following Debian packages are required:
-
maven (version 3 is default)
-
postgresql-9.5
-
tomcat8
-
tomcat8-admin
-
openjdk-8-jdk
sudo apt-get install maven postgresql-9.5 tomcat8 tomcat8-admin openjdk-8-jdk
The ci-web and visualization-datasource git repositories need to be cloned:
git clone https://github.com/ci-rt/ci-web.git git clone https://github.com/ci-rt/visualization-datasource.git
Jenkins uses a database to fill in the test results. Those test results are visualized by ci-web. For setup of the database please consider database README. The database can be hosted on the CI-WEB instance.
tomcat8 is setup and started after installation. To deploy a WAR file, a user with the role "manager-gui" is needed. An explanation is given when calling http://localhost:8080/manager/html and abort the prompted login.
To deploy the web application on tomcat, a WAR file needs to be created. The versioning of the web application is defined in the pom.xml file and differentiate between release and development.
create visualization-datasource, that is required by ci-web:
cd visualization-datasource mvn install
create ci-web WAR file:
cd ci-web mvn package
WAR file is available: ci-web/target/NAME##VERSION.war
During development, the WAR file can be tested using jetty:
cd ci-web mvn jetty:run
The web application is then available via http://localhost:9090
After development, the WAR file can be deployed on tomcat. Therefore, open http://localhost:8080/manager/html in the web browser. The WAR file to deploy can be uploaded and then started in the Applications overview web interface.
The database access can be configured in two alternative ways:
-
db.properties file
-
servlet context
Caution: Configurations done in servlet context will override configurations of db.properties file!
The db.properties file can be changed to fit the own needs either before compilation (location is html/WEB-INF/db.properties) or after deployment. The disadvantage of this method is, that db.properties file has to be adapted for every new version of ci-web. It might be an easy and fast solution during development.
When changing db.properties file after deployment, tomcat needs to be restarted.
For persistent configuration of database access, usage of the servlet context is best practice here.
Therefore, please edit the global configuration file ${Catalina_base}/conf/context.xml (On debian systems /etc/tomcatX/context.xml) and add the following XML snippet into the <Context> section (change the parameters to suit your needs):
<Parameter name="URL" value="jdbc:postgresql://db.example.com/RT-Test?currentSchema=ci-rt"/> <Parameter name="debug" value="true"/> <Parameter name="dialect" value="org.hibernate.dialect.PostgreSQLDialect"/> <Parameter name="class" value="org.postgresql.Driver"/> <Parameter name="user" value="user"/> <Parameter name="password" value="password"/>
A restart of tomcat is required after the change. The database configuration is then available through the servlet context.
The XML snippet above is also added to META-INF/context.xml but commented out. Experienced tomcat administrators could use this file as base for context.xml based web application deployment of ci-web.
The CI-RT Web application is provided under the terms of the MIT license as provided in the LICENSES/MIT file.
Instead of adding MIT boilerplates to the individual files, CI-RT uses SPDX license identifiers, which are machine parseable and considered legaly equivalent.
The SPDX license identifier in CI-RT Web application shall be added at the first possible line in a file which can contain a comment. This is normally the first line except for scripts. Scripts require the #!PATH_TO_INTERPRETER tag in the first line; place the SPDX identifier into the second line.
The SPDX license identifier is added in form of a comment. The comment style depends on the file type::
files/scripts | SPDX license identifier |
---|---|
bash |
# SPDX-License-Identifier: <SPDX License Expression> |
css |
/* SPDX-License-Identifier: <SPDX License Expression> */ |
groovy |
// SPDX-License-Identifier: <SPDX License Expression> |
html |
<!-- SPDX-License-Identifier: <SPDX License Expression> -โ |
java |
// SPDX-License-Identifier: <SPDX License Expression> |
js |
/* SPDX-License-Identifier: <SPDX License Expression> */ |
python |
# SPDX-License-Identifier: <SPDX License Expression> |
sass |
// SPDX-License-Identifier: <SPDX License Expression> |
xml |
<!-- SPDX-License-Identifier: <SPDX License Expression> -โ |