You are not logged in. Click here to log in.

codebeamer Application Lifecycle Management (ALM)

Search In Project

Search inClear

Tags:  not added yet

Preconditions

  1. This document is based on CentOS 7, any additional command will be marked for CentOS 8
  2. Default user called 'centos' was used with user id of 1000 by default
  3. There were no firewall (firewalld) running on the host

Installation steps

Disable selinux by editing /etc/selinux/config file and set SELINUX to disabled as root user or use sudo, then reboot the host

sudo sed -i 's/^SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

Verify:

sudo grep ^SELINUX= /etc/selinux/config
SELINUX=disabled

Verifiy firewalld service

FirewallD is included by default with CentOS 7 but it’s inactive.

CentOS 8 is starting with activated FirewallD service though and so it has to be aligned to handle source NAT rules. Run the following command as root user or use sudo:

sudo firewall-cmd --zone=public --add-masquerade --permanent
sudo systemctl restart firewalld

Verify if docker daemon and docker-compose are installed

Docker part

Source: https://docs.docker.com/engine/install/centos/

For CentOS 7:

sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io
sudo systemctl enable docker --now

For CentOS 8:

sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io --nobest
sudo systemctl enable docker --now

Verify:

docker --version
Docker version 19.03.11, build 42e35e61f3
Docker-compose part
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

Verify:

docker-compose --version
docker-compose version 1.26.0, build d4451659

Reboot the host to apply selinux change and check if docker daemon started

sudo reboot

Prepare for codebeamer X installation

Create directories
cd /home/centos
mkdir -p {codebeamerx/data,codebeamerx/data/logs,codebeamerx/data/repository/docs,codebeamerx/data/repository/search,codebeamerx/cert}

Verify:

tree -a codebeamerx
codebeamerx
├── cert
└── data
    ├── log
    └── repository

Set permission to 777 for data directory recursively
sudo chmod 777 -R codebeamerx/data
Create self-signed certificate for HTTPS traffic (replace the domain name with your choice)
cd cert
openssl genrsa -out codebeamerx.example.net.key 2048
openssl req -new -x509 -key codebeamerx.example.net.key -out codebeamerx.example.net.cert -days 365 -subj /CN=codebeamerx.example.net
Allow the given user (centos here) to run docker containers by adding it to docker group
sudo usermod -aG docker centos
Prepare docker-compose.yml file for bringing up codebeamer X environment

Create a file named docker-compose.yml with the content below in /home/centos/codebeamerx directory:

# Copyright by Intland Software, https://www.intland.com
#
# All rights reserved.
#
# Please note that if you change this docker file, we do not take any responsibility and we are not liable for
# any damage caused through use of this image, be it indirect, special, incidental
# or consequential damages (including but not limited to damages for loss of business, loss of profits, interruption or the like).

version: '2.1'

services:
  retina-db:
    image: intland/mysql-utf8mb4:5.7.24
    environment:
      - MYSQL_USER=user
      - MYSQL_PASSWORD=pass
      - MYSQL_DATABASE=retina
      - MYSQL_MAX_ALLOWED_PACKET=1024M
      - MYSQL_INNODB_BUFFER_POOL_SIZE=1G
      - MYSQL_INNODB_LOG_FILE_SIZE=256M
      - MYSQL_INNODB_LOG_BUFFER_SIZE=256M
    volumes:
      - retina-db-data:/var/lib/mysql/data


  retina-app:
    image: intland/codebeamer-x:4.1
    ports:
      - 8888:8080
    environment:
      - WAIT_HOSTS=container-mysql:3306
      - WAIT_HOSTS_TIMEOUT=120
      - CB_REDIRECT_TO=/x
      - CB_CONTEXT_PATH=cb
      - CB_database_JDBC_Username=user
      - CB_database_JDBC_Password=pass
      - CB_database_JDBC_Driver=com.mysql.jdbc.Driver
      - CB_database_JDBC_ConnectionURL=jdbc:mysql://container-mysql:3306/retina?autoReconnect=true&zeroDateTimeBehavior=convertToNull&emulateLocators=true&characterEncoding=UTF-8&useSSL=false
      - CB_database_JDBC_Timeout=120
      - CB_MAC_ADDRESS=<<YOUR MAC ADDRESS>>
    volumes:
      - /home/centos/retina/data/repository/docs:/home/appuser/codebeamer/repository/docs
      - /home/centos/retina/data/repository/search:/home/appuser/codebeamer/repository/search
      - /home/centos/retina/data/logs:/home/appuser/codebeamer/logs
    links:
      - retina-db:container-mysql


  retina-httpd:
    image: intland/httpd:1.2
    ports:
      - 80:8887
      - 443:8888
    environment:
      - WAIT_HOSTS=retina-app:8080
      - WAIT_HOSTS_TIMEOUT=180
    volumes:
      - /home/centos/retina/cert/retina.example.net.cert:/home/appuser/certificates/pem/certificate-file.pem
      - /home/centos/retina/cert/retina.example.net.key:/home/appuser/certificates/pem/certificate-key-file.pem
#      - <PATH_TO_CERTIFICATE_CHAIN_IF_YOU_HAVE>:/home/appuser/certificates/pem/ca-bundle.crt
    links:
        - retina-app:codebeamer-app


volumes:
  retina-db-data:

In case you want to use your existing MySQL database

# Copyright by Intland Software, https://www.intland.com
#
# All rights reserved.
#
# Please note that if you change this docker file, we do not take any responsibility and we are not liable for
# any damage caused through use of this image, be it indirect, special, incidental
# or consequential damages (including but not limited to damages for loss of business, loss of profits, interruption or the like).


version: '2.1'


services:
  retina-app:
    image: intland/codebeamer-x:4.1
    ports:
      - 8888:8080
    environment:
      - WAIT_HOSTS=<DATABASE_SERVER_HOST>:<DATABASE_SERVER_PORT>
      - WAIT_HOSTS_TIMEOUT=120
      - CB_REDIRECT_TO=/x
      - CB_CONTEXT_PATH=cb
      - CB_database_JDBC_Username=<DATABASE_SERVER_USERNAME>
      - CB_database_JDBC_Password=<DATABASE_SERVER_PASSWORD>
      - CB_database_JDBC_Driver=com.mysql.jdbc.Driver
      - CB_database_JDBC_ConnectionURL=jdbc:mysql://<DATABASE_SERVER_HOST>:<DATABASE_SERVER_PORT>/<SCHEMA>?autoReconnect=true&zeroDateTimeBehavior=convertToNull&emulateLocators=true&characterEncoding=UTF-8&useSSL=false
      - CB_database_JDBC_Timeout=120
      - CB_MAC_ADDRESS=<<YOUR MAC ADDRESS>>
    volumes:
      - /home/centos/retina/data/repository/docs:/home/appuser/codebeamer/repository/docs
      - /home/centos/retina/data/repository/search:/home/appuser/codebeamer/repository/search
      - /home/centos/retina/data/logs:/home/appuser/codebeamer/logs

  retina-httpd:
    image: intland/httpd:1.2
    ports:
      - 80:8887
      - 443:8888
    environment:
      - WAIT_HOSTS=retina-app:8080
      - WAIT_HOSTS_TIMEOUT=180
    volumes:
      - /home/centos/retina/cert/retina.example.net.cert:/home/appuser/certificates/pem/certificate-file.pem
      - /home/centos/retina/cert/retina.example.net.key:/home/appuser/certificates/pem/certificate-key-file.pem
#      - <PATH_TO_CERTIFICATE_CHAIN_IF_YOU_HAVE>:/home/appuser/certificates/pem/ca-bundle.crt
    links:
        - retina-app:codebeamer-app

Bring up codebeamer X environment and verify it
cd /home/centos/codebeamerx
docker-compose up -d

Verify all the container up and healthy:

docker ps
CONTAINER ID        IMAGE                  COMMAND                  CREATED              STATUS                        PORTS                                         NAMES
6d2f287d3c90        intland/httpd:1.1      "/run_httpd.sh"          About a minute ago   Up About a minute (healthy)   0.0.0.0:80->8887/tcp, 0.0.0.0:443->8888/tcp   codebeamerx_codebeamerx-httpd_1
b8a8711938e7        intland/codebeamer-x:4.0   "/home/appuser/endpo…"   About a minute ago   Up About a minute (healthy)   0.0.0.0:8888->8080/tcp                        codebeamerx_codebeamerx-app_1
0d3a8c3f03a5        intland/mysql:5.7.24   "container-entrypoin…"   About a minute ago   Up About a minute (healthy)   3306/tcp                                      codebeamerx_codebeamerx-db_1

Open codebeamer X in your browser on the https://<domain or ip>/x/

Backup and restore

This backup and restore procedure is aligned to the environment brought up from the docker-compose.yml file above, other environments need to be aligned properly


Backup

Set the BASE_DIR, BACKUP_DIR environment variables

BASE_DIR=/home/centos/codebeamerx
BACKUP_DIR=${BASE_DIR}/backups
mkdir ${BACKUP_DIR}

Stop application and httpd container

cd ${BASE_DIR}
docker stop codebeamerx-httpd_codebeamerx-httpd_1 codebeamerx-httpd_codebeamerx-app_1

Create database dump

sync
docker exec codebeamerx-db_codebeamerx-db_1 /opt/rh/rh-mysql57/root/usr/bin/mysqldump --hex-blob --routines --protocol=tcp -uuser -ppass --add-drop-database --max_allowed_packet=1024M --single-transaction --order-by-primary --net_buffer_length=4096 --default-character-set=utf8mb4 --quick --databases codebeamerx > ${BACKUP_DIR}/mysql.dump

#Optionally, you can compress it with tar, zip or any other compressing tool that you prefer
#Tar example
tar cvzf ${BACKUP_DIR}/mysql.dump.tar.gz backups/mysql.dump

Archive data directory (archiving data/logs directory is optional)

sync
tar cvzf ${BACKUP_DIR}/repository.tar.gz data/repository data/logs

Start back application and httpd container

docker-compose down
docker-compose up -d

Restore

Set the BASE_DIR, BACKUP_DIR environment variables

BASE_DIR=/home/centos/codebeamerx
BACKUP_DIR=${BASE_DIR}/backups
mkdir ${BACKUP_DIR}

Stop application and httpd container

cd ${BASE_DIR}
docker stop codebeamerx-httpd_codebeamerx-httpd_1 codebeamerx-httpd_codebeamerx-app_1

Import database from an database dump file

cat backups/mysql.dump | docker exec -i codebeamerx-db_codebeamerx-db_1 /opt/rh/rh-mysql57/root/usr/bin/mysql -uuser -ppass

Remove old repository and logs directory

rm -rf data/repository data/logs

Extract repository files from the backup

tar xvzf backups/repository.tar.gz

Start back application and httpd container

docker start codebeamerx-httpd_codebeamerx-app_1 codebeamerx-httpd_codebeamerx-httpd_1