jira自动安装脚本

#!/bin/bash

#    设置jira程序安装目录
APP_DIR=/usr/local/jirasoftware

#    设置jira数据目录
DATA_DIR=/var/jirasoftware-home

#    设置jira最大使用内存 MB,保留512MB给系统和其他程序使用
JIRA_MEM=$(expr  `cat /proc/meminfo | grep MemTotal | awk '{print $2}'` / 1024  - 512)

#    设置jira数据库账号密码
JIRA_DBPW='jira_mysql_password'

#    纯净centos7系统优化:YUM、EPEL、常用工具、防火墙、SELinux、SSH
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum install -y epel-release
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum install -y vim wget net-tools bash-completion jq git sysstat  lftp  lrzsz
systemctl  stop  firewalld && systemctl  disable  firewalld
setenforce  0  &&  getenforce
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
echo 'UseDNS no' >> /etc/ssh/sshd_config
systemctl restart sshd.service
echo 'StrictHostKeyChecking no' >> /etc/ssh/ssh_config

#    下载 jira 8.8.0 版本安装包
wget https://product-downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-8.8.0.tar.gz

#    下载 mysql odbc 驱动
wget https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-5.1.48.tar.gz

#    下载 jira 破解文件
wget https://img2020.cnblogs.com/blog/944907/202003/944907-20200326113215974-209400781.png -O atlassian-extras-3.2.jar

#    创建jira程序安装目录
mkdir -p $APP_DIR

#    解压安装文件到程序安装目录
tar -xzf atlassian-jira-software-8.8.0.tar.gz -C $APP_DIR
mv  /usr/local/jirasoftware/atlassian-jira-software-8.8.0-standalone/* /usr/local/jirasoftware/
rm -rf  /usr/local/jirasoftware/atlassian-jira-software-8.8.0-standalone

#    创建jira数据目录
mkdir -p $DATA_DIR

#    配置jira数据目录位置
echo jira.home=$DATA_DIR > $APP_DIR/atlassian-jira/WEB-INF/classes/jira-application.properties

#    安装 MariaDB 和 JDK
yum install -y mysql mariadb-server java-1.8.0-openjdk

#    配置MariaDB:创建数据库jira(utf-8)  用户jira  密码$JIRA_DBPW
systemctl enable mariadb.service
systemctl start mariadb.service
mysql -e "create database jira character set utf8 collate utf8_bin;"
mysql -e "grant all privileges on jira.* to jira@localhost identified by '$JIRA_DBPW';"
mysql -e "flush privileges;"

#    配置 mysql odbc 驱动
tar zxf mysql-connector-java-5.1.48.tar.gz
cp mysql-connector-java-5.1.48/mysql-connector-java-5.1.48-bin.jar $APP_DIR/lib/

#    配置 jira最大使用内存 MB
sed -i 's/^JVM_MAXIMUM_MEMORY=.*/JVM_MAXIMUM_MEMORY="'$JIRA_MEM'm"/' $APP_DIR/bin/setenv.sh

#    破解jira
\cp -f atlassian-extras-3.2.jar $APP_DIR/atlassian-jira/WEB-INF/lib/atlassian-extras-3.2.jar

#    启动jira
$APP_DIR/bin/start-jira.sh

#    使用说明
echo 'jira访问地址 http://x.x.x.x:8080'
echo '我将设置它自己 I Well set it myself'
echo 'jira数据库选:My Own Database'
echo 'Database Type: Mysql 5.6'
echo 'Hostname: localhost'
echo 'Database: jira'
echo 'Port: 3306'
echo 'Username: jira'
echo 'Password: '$JIRA_DBPW''
echo -en '\n后面按照提示申请一个评估的许可证\n'
echo -en '\njira启动命令:'$APP_DIR'/bin/start-jira.sh\n'
echo 'jira停止命令:'$APP_DIR'/bin/stop-jira.sh'
echo -en '\n数据库备份文件存储位置: '$DATA_DIR'/export\n'
echo '附件(上传的图片等文件)存储位置: '$DATA_DIR'/data/attachments'

 

 
 
 
 
 

 

此处无图

posted @ 2020-03-26 11:33  三角形  阅读(540)  评论(0编辑  收藏  举报