Deploying Jira
For deploying Jira, a common approach involves using a pre-configured Docker image. Ensure you have the necessary license or are using it in a compliant manner. The deployment typically requires a database connection, which we will configure in the docker-compose.yml file.
Deploying Bugzilla
Bugzilla is a web-based bug tracking system. We will deploy it using a Docker image and configure it to connect to a MySQL database.
1. Pull the Bugzilla Image
First, pull the official Bugzilla Docker image from the Docker Hub. The nasqueron/bugzilla image is a popular choice.
docker pull nasqueron/bugzilla:latest
2. Configure the localconfig File
Bugzilla's primary configuration is managed through the localconfig file. Create a directory for Bugzilla and place this file within it.
mkdir -p bugzilla_config
cd bugzilla_config
vim localconfig
Populate the localconfig file with the following settings, adjusting the database and SMTP details as needed:
# Bugzilla Database Configuration
$db_type = 'mysql'; # Database type, e.g., MySQL
$db_host = 'mysql_service'; # Database server address: service name
$db_port = '3306'; # Database port
$db_name = 'bugzilla_db'; # Database name
$db_user = 'bugzilla_user'; # Database username
$db_pass = 'secure_password'; # Database password
# Email Sending Settings
$mail_program = '/usr/sbin/sendmail';
$bugzilla_from = 'noreply@yourdomain.com'; # Sender email address
$smtp_server = 'smtp.yourprovider.com'; # SMTP server address
$smtp_port = '465'; # SMTP port (SSL)
$smtp_username = 'noreply@yourdomain.com'; # Your email address
$smtp_password = 'your_smtp_password'; # Your email password
$smtp_use_tls = 1;
$mail_delivery_method = 'SMTP'; # Specify email delivery method as SMTP
Docker Compose Setup
We will use a single docker-compose.yml file to orchestrate MySQL, Jira, and Bugzilla services. This setup ensures each application has its own dedicated database.
1. docker-compose.yml
Create a docker-compose.yml file with the following content. This configuration defines three services: MySQL, Jira, and Bugzilla, all connetced to a custom network.
version: '3.9'
services:
mysql_service:
image: mysql:5.7
container_name: mysql_container
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: root_password
MYSQL_DATABASE_jira: jira_db
MYSQL_DATABASE_bugzilla: bugzilla_db
MYSQL_USER_jira: jira_user
MYSQL_PASSWORD_jira: jira_pass
MYSQL_USER_bugzilla: bugzilla_user
MYSQL_PASSWORD_bugzilla: bugzilla_pass
networks:
- app-network
volumes:
- ./mysql_data:/var/lib/mysql
- ./init_db.sql:/docker-entrypoint-initdb.d/init_db.sql
- ./mysqld_config.cnf:/etc/mysql/conf.d/mysqld.cnf
jira_app:
image: atlassian/jira-software:8.20.0
container_name: jira_container
ports:
- "8080:8080"
depends_on:
- mysql_service
environment:
- DB_HOST=mysql_service
- DB_PORT=3306
- DB_NAME=jira_db
- DB_USER=jira_user
- DB_PASSWORD=jira_pass
networks:
- app-network
volumes:
- ./jira_data:/var/atlassian/application-data/jira
bugzilla_app:
image: nasqueron/bugzilla
container_name: bugzilla_container
ports:
- "8081:80"
depends_on:
- mysql_service
environment:
- DB_HOST=mysql_service
- DB_PORT=3306
- DB_DATABASE=bugzilla_db
- DB_USER=bugzilla_user
- DB_PASSWORD=bugzilla_pass
- BUGZILLA_URL=https://bugzilla.yourdomain.com
networks:
- app-network
volumes:
- ../bugzilla_config/localconfig:/usr/share/webapps/bugzilla/localconfig
networks:
app-network:
driver: bridge
2. MySQL Configuration (mysqld_config.cnf)
This file customizes MySQL settings for optimal performance with Jira and Bugzilla. It includes specific configurations for each database.
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
skip-host-cache
skip-name-resolve
bind-address = 0.0.0.0
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
log_error = /var/log/mysql/error.log
innodb_file_per_table = 1
innodb_buffer_pool_size = 256M
# Jira Database Settings
[client_jira]
user = jira_user
password = jira_pass
[jira_db]
default-storage-engine=INNODB
character_set_server=utf8mb4
innodb_default_row_format=DYNAMIC
innodb_large_prefix=ON
innodb_file_format=Barracuda
innodb_log_file_size=2G
# Bugzilla Database Settings
[client_bugzilla]
user = bugzilla_user
password = bugzilla_pass
[bugzilla_db]
default-storage-engine=INNODB
character_set_server=utf8mb4
innodb_default_row_format=DYNAMIC
innodb_large_prefix=ON
innodb_file_format=Barracuda
innodb_log_file_size=2G
3. Database Initialization (init_db.sql)
This SQL script initializes the Jira and Bugzilla databases and creates the necessary users with appropriate permissions.
CREATE DATABASE jira_db CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,REFERENCES,ALTER,INDEX ON jira_db.* TO 'jira_user'@'%' IDENTIFIED BY 'jira_pass';
GRANT ALL PRIVILEGES ON jira_db.* TO 'jira_user'@'%' IDENTIFIED BY 'jira_pass';
CREATE DATABASE bugzilla_db CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,REFERENCES,ALTER,INDEX ON bugzilla_db.* TO 'bugzilla_user'@'%' IDENTIFIED BY 'bugzilla_pass';
GRANT ALL PRIVILEGES ON bugzilla_db.* TO 'bugzilla_user'@'%' IDENTIFIED BY 'bugzilla_pass';
FLUSH PRIVILEGES;
4. Running the Services
Execute the following command in the directory containing your docker-compose.yml file to start all services:
docker-compose up -d
If Jira fails to start initially due to database connection issues, you may need to restart the Jira container after the MySQL service is fully initialized:
docker-compose restart jira_app
Post-Deployment Steps for Bugzilla
After Bugzilla starts, check its logs. The initial setup creates a default administrator account. Use these credentials to log in. It's recommended to create a new administrative user from the "Administration" menu and assign full permissions to avoid access issues. Ansure the email address used for the new user is valid.
Common Issue: Email Sending Error
If you encounter an error related to sendmail when trying to perform actions like creating a new bug, it's likely due to misconfigured email settings. To resolve this, disable email delivery in Bugzilla's administration panel:
- Log in as an administrator.
- Navigate to Administration > Parameters > Email.
- Set
mail_delivery_methodtonone.