Docker篇 (九) Jira的安装

本文详细介绍了如何使用Docker安装配置MySQL 5.7、Jira Software 8.3.0及Xray插件,包括数据库配置、Jira初始设置、插件试用与破解过程。

一、MySQL5.7的安装

1.1 拉取镜像

docker pull mysql:5.7

1.2 创建容器

docker run -d --restart=always --name mysql \
  -v /etc/localtime:/etc/localtime:ro \
  -v /ljh/mysql/data:/var/lib/mysql \
  -e MYSQL_ROOT_PASSWORD=123456 \
  -p 3306:3306 \
  mysql:5.7

1.3 修改mysqld.cnf配置文件

# 先拷贝出容器中的mysqld.cnf文件
docker cp mysql:/etc/mysql/mysql.conf.d/mysqld.cnf /ljh/mysql/mysqld.cnf
 
# 修改拷贝出的文件,在[mysqld]下加入配置
[mysqld]
# 表名大小写不敏感
lower_case_table_names=1

# 以下为jira文档中说明要加的配置
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
 
# 把修改好后的文件拷贝到容器中
docker cp /ljh/mysql/mysqld.cnf mysql:/etc/mysql/mysql.conf.d/mysqld.cnf

# 重启容器
docker restart mysql

1.4 创建Jira数据库及账号 

# 创建数据库
CREATE DATABASE jira CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;

# 创建账号jira,密码Jira#123456
GRANT ALL on jira.* TO 'jira'@'%' IDENTIFIED BY 'Jira#123456';
flush privileges;

二、Jira-software8.3.0的安装

2.1 JIRA Core、JIRA Software and JIRA Service Desk的区别

JIRA Core是为内部团队跟踪和一起解决项目或问题的。

JIRA Software类似于JIRA Core,为使用敏捷/看板方法的开发团队提供了额外的功能。

JIRA Service Desk是为收到来自其他团队或客户的问题及请求的团队服务的。

参考Jira官网的说明

2.2 拉取镜像

docker pull atlassian/jira-software:8.3.0

2.3 创建容器

docker run -d --restart=always --name jira \
  -v /etc/localtime:/etc/localtime:ro \
  -v /usr/local/soft/jira:/var/atlassian/application-data/jira \
  -p 8080:8080 \
  atlassian/jira-software:8.3.0

2.4 mysql链接库

# 把mysql-connector-java-5.1.49.jar下载到宿主机的/root目录下
docker cp ~/mysql-connector-java-5.1.49.jar jira:/opt/atlassian/jira/lib

# 重启jira
docker restart jira

2.5 初始配置

首次打开Web页面进行初始配置,选择语言,然后选择"我自己来设置它",再点【下一步】

配置数据库连接再点击【测试连接】按钮,出现"数据库连接测试成功"后,点击【下一步】系统会自动创建表结构和数据

 按默认的程序标题和基本URL,然后点击【下一步】

2.6 试用许可证

通过“生成Jira试用许可证”的连接,获取许可证(需要注册Atlassian公司的账号),再点击【下一步】

在Atlassian的网站上按如下操作

获取到许可证关键字后点【下一步】按钮 

设置管理员账号和密码后点【下一步】按钮 

配置完成后下图

 2.7 破解

# 把atlassian-extras-3.2.jar下载到宿主机的/root目录下
docker cp ~/atlassian-extras-3.2.jar jira:/opt/atlassian/jira/atlassian-jira/WEB-INF/lib

# 重启jira
docker restart jira

进入设置中的"应用程序"

显示已经破解成功了 

2.8 查看运行日志

tail -f /usr/local/soft/jira/log/atlassian-jira.log

2.9 备份与升级

docker stop jira
docker rm jira

docker run ... (See above)
docker cp ~/mysql-connector-java-5.1.49.jar jira:/opt/atlassian/jira/lib
docker cp ~/atlassian-extras-3.2.jar jira:/opt/atlassian/jira/atlassian-jira/WEB-INF/lib
docker restart jira

数据备份主要是备份/usr/local/soft/jira目录和MySQL,由于数据存储在宿主机上的/usr/local/soft/jira目录和MySQL中,因此在升级之后仍然可用, 详细备份方法参考Atlassian官方说明

三、安装Jira的插件Xray

Xray、Zephyr、synapseRT是Jira中测试管理大家使用较多的3个插件,我这里只安装了Xray。

3.1 在管理应用--查找新应用中找到Xray,进行试用

3.2  破解

# 把atlassian-universal-plugin-manager-plugin-4.0.4.jar下载到宿主机的/root目录下
docker cp ~/atlassian-universal-plugin-manager-plugin-4.0.4.jar jira:/opt/atlassian/jira/atlassian-jira/WEB-INF/atlassian-bundled-plugins

# 重启jira
docker restart jira

3.3 破解完成 

 四、破解包的制作

atlassian-extras-3.2.jar和atlassian-universal-plugin-manager-plugin-4.0.4.jar的破解方式相同,都是反编译以下2个类后进行更改

  • com.atlassian.extras.decoder.v2.Version2LicenseDecoder
  • com.atlassian.license.LicenseManager

4.1 LicenseManager.java

# 原来的
public boolean hasValidLicense(String licenseKey)
{
  return (getLicense(licenseKey) != null) && (!getLicense(licenseKey).isExpired());
}


# 新的
public boolean hasValidLicense(String licenseKey)
{
  return true;
}

4.2 Version2LicenseDecoder.java

# 原来的
private Properties loadLicenseConfiguration(Reader text) {
    try {
        Properties props = new Properties();
        (new DefaultPropertiesPersister()).load(props, text);
        return props;
    } catch (IOException var3) {
        throw new LicenseException("Could NOT load properties from reader", var3);
    }
}

# 新的函数,JIRA/Confluence/FishEye/Bitbucket都是Atlassian的产品
private Properties loadLicenseConfiguration(Reader text)
{
	try
	{
	  Properties props = new Properties();
	  new DefaultPropertiesPersister().load(props, text);
	  if (props.containsKey("Description"))
	  {
		String desc = props.getProperty("Description");
		props.put("Description", 
		  desc.replace("Evaluation", "Commercial"));
		if (desc.contains("Confluence")) {
		  props.put("conf.LicenseTypeName", "COMMERCIAL");
		} else if (desc.contains("JIRA")) {
		  props.put("jira.LicenseTypeName", "COMMERCIAL");
		} else if (desc.contains("FishEye")) {
		  props.put("fisheye.LicenseTypeName", "COMMERCIAL");
		} else if (desc.contains("Bitbucket")) {
		  props.put("stash.LicenseTypeName", "COMMERCIAL");
		}
		props.put("Evaluation", "false");
		props.put("MaintenanceExpiryDate", "2033-02-09");
		props.put("LicenseExpiryDate", "2033-02-09");
	  }	  
	  return props;
	}
	catch (IOException e)
	{
	  throw new LicenseException("Could NOT load properties from reader", e);
	}
}

4.3 步骤

4.3.1 先从容器中拷贝出原来的jar文件,然后解压到文件夹中,进入上面2个类的目录,在相同目录下创建同名的java文件,把class中反编译的内存拷贝到java中,然后按4.1和4.2进行修改

4.3.2 设置系统变量classpath,把jar解压时的目录加入到classpath中

4.3.4 下载commons-codec-1.14.jar包,因为代码中用到了org.apache.commons.codec.binary.Base64

4.3.4 执行javac编译文件

4.3.5 把编译好的class文件拷贝回原始的jar包

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值