Code Monkey home page Code Monkey logo

ci-web's Introduction

CI-WEB instance

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".

Setup of CI-WEB instance

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

Configure database

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.

Configure tomcat8

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.

Creating CI-RT Web application

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.

build WAR file

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

deploy WAR file (jetty and tomcat)

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.

Configure database access

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!

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.

servlet context

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.

Make a release

The versions are handled via pom.xml file. To create a new release, version tag has to be changed to the new release number. If there is a SNAPSHOT behind release, web application is under development and is in preparation for the next release.

License rules

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> -โ†’

Copyright notices shall be placed right below the SPDX identifier with the same comment format as the SPDX identifier. The canonical form for a copyright notice is:

Copyright (c) <year> <copyright holders>

ci-web's People

Contributors

bene42 avatar anna-marialx avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar Manuel Traut avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.