jira自动安装脚本

时间:2020-03-26
本文章向大家介绍jira自动安装脚本,主要包括jira自动安装脚本使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
 1 #!/bin/bash
 2 
 3 #    设置jira程序安装目录
 4 APP_DIR=/usr/local/jirasoftware
 5 
 6 #    设置jira数据目录
 7 DATA_DIR=/var/jirasoftware-home
 8 
 9 #    设置jira最大使用内存 MB,保留512MB给系统和其他程序使用
10 JIRA_MEM=$(expr  `cat /proc/meminfo | grep MemTotal | awk '{print $2}'` / 1024  - 512)
11 
12 #    设置jira数据库账号密码
13 JIRA_DBPW='jira_mysql_password'
14 
15 #    纯净centos7系统优化:YUM、EPEL、常用工具、防火墙、SELinux、SSH
16 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
17 yum install -y epel-release
18 curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
19 yum install -y vim wget net-tools bash-completion jq git sysstat  lftp  lrzsz
20 systemctl  stop  firewalld && systemctl  disable  firewalld
21 setenforce  0  &&  getenforce
22 sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
23 echo 'UseDNS no' >> /etc/ssh/sshd_config
24 systemctl restart sshd.service
25 echo 'StrictHostKeyChecking no' >> /etc/ssh/ssh_config
26 
27 #    下载 jira 8.8.0 版本安装包
28 wget https://product-downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-8.8.0.tar.gz
29 
30 #    下载 mysql odbc 驱动
31 wget https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-5.1.48.tar.gz
32 
33 #    下载 jira 破解文件
34 #wget xxxxxx 后面补充
35 
36 #    创建jira程序安装目录
37 mkdir -p $APP_DIR
38 
39 #    解压安装文件到程序安装目录
40 tar -xzf atlassian-jira-software-8.8.0.tar.gz -C $APP_DIR
41 mv  /usr/local/jirasoftware/atlassian-jira-software-8.8.0-standalone/* /usr/local/jirasoftware/
42 rm -rf  /usr/local/jirasoftware/atlassian-jira-software-8.8.0-standalone
43 
44 #    创建jira数据目录
45 mkdir -p $DATA_DIR
46 
47 #    配置jira数据目录位置
48 echo jira.home=$DATA_DIR > $APP_DIR/atlassian-jira/WEB-INF/classes/jira-application.properties
49 
50 #    安装 MariaDB 和 JDK
51 yum install -y mysql mariadb-server java-1.8.0-openjdk
52 
53 #    配置MariaDB:创建数据库jira(utf-8)  用户jira  密码$JIRA_DBPW
54 systemctl enable mariadb.service
55 systemctl start mariadb.service
56 mysql -e "create database jira character set utf8 collate utf8_bin;"
57 mysql -e "grant all privileges on jira.* to jira@localhost identified by '$JIRA_DBPW';"
58 mysql -e "flush privileges;"
59 
60 #    配置 mysql odbc 驱动
61 tar zxf mysql-connector-java-5.1.48.tar.gz
62 cp mysql-connector-java-5.1.48/mysql-connector-java-5.1.48-bin.jar $APP_DIR/lib/
63 
64 #    配置 jira最大使用内存 MB
65 sed -i 's/^JVM_MAXIMUM_MEMORY=.*/JVM_MAXIMUM_MEMORY="'$JIRA_MEM'm"/' $APP_DIR/bin/setenv.sh
66 
67 #    破解jira
68 \cp -f atlassian-extras-3.2.jar $APP_DIR/atlassian-jira/WEB-INF/lib/atlassian-extras-3.2.jar
69 
70 #    启动jira
71 $APP_DIR/bin/start-jira.sh
72 
73 #    使用说明
74 echo 'jira访问地址 http://x.x.x.x:8080'
75 echo '我将设置它自己 I Well set it myself'
76 echo 'jira数据库选:My Own Database'
77 echo 'Database Type: Mysql 5.6'
78 echo 'Hostname: localhost'
79 echo 'Database: jira'
80 echo 'Port: 3306'
81 echo 'Username: jira'
82 echo 'Password: '$JIRA_DBPW''
83 echo -en '\n后面按照提示申请一个评估的许可证\n'
84 echo -en '\njira启动命令:'$APP_DIR'/bin/start-jira.sh\n'
85 echo 'jira停止命令:'$APP_DIR'/bin/stop-jira.sh'
86 echo -en '\n数据库备份文件存储位置: '$DATA_DIR'/export\n'
87 echo '附件(上传的图片等文件)存储位置: '$DATA_DIR'/data/attachments'
 
 
 
 

 

此处无图

$flag 上一页 下一页