这套工具, 是在某一次观摩朋友公司大型发版过程中, 学到的, 发现使用起来挺方便, 正好我们公司的流程管理工具不是很方便, 就借鉴了一下. 记录一下搭建过程和遇到的一些坑
好的流程管理工具, 可以提高每个部门之间协作的效率, 让大家更便捷、更高效
 
 
构建 Jria 和 Confluence 镜像并修改相关配置 1 2 3 4 5 6 7 8 9 10 FROM  cptactionhank/atlassian-confluence:7.9 .0 USER  rootCOPY  "atlassian-agent.jar"  /opt/atlassian/confluence/ RUN  echo  'export CATALINA_OPTS="-javaagent:/opt/atlassian/confluence/atlassian-agent.jar ${CATALINA_OPTS}"'  >> /opt/atlassian/confluence/bin/setenv.sh 
 
1 2 3 4 5 6 7 8 9 10 FROM  cptactionhank/atlassian-jira-software:8.1 .0 USER  rootCOPY  "atlassian-agent.jar"  /opt/atlassian/jira/ RUN  echo  'export CATALINA_OPTS="-javaagent:/opt/atlassian/jira/atlassian-agent.jar ${CATALINA_OPTS}"'  >> /opt/atlassian/jira/bin/setenv.sh 
 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 version: "3.7" services:   atlassian-mysql:     image: mysql:5.7     container_name: atlassian-mysql     ports:       - "3306:3306"     restart: unless-stopped     networks:       atlassian-net:         aliases:           - mysql     environment:       - MYSQL_ROOT_PASSWORD=123456     volumes:       - ./data/mysql-data/mysql:/var/lib/mysql       - ./data/mysql-data/mysql.conf.d:/etc/mysql/mysql.conf.d   jira:     image: base/jira:8.1.0     container_name: jira     ports:       - "4000:8080"     restart: unless-stopped     depends_on:       - atlassian-mysql     networks:       atlassian-net:         aliases:           - jira     volumes:       - ./data/jira-data/jira:/var/atlassian/jira       - ./data/jira-conf/jira:/opt/atlassian/jira   confluence:     image: base/confluence:7.9.0     container_name: confluence     ports:       - "5000:8090"     restart: unless-stopped     depends_on:       - atlassian-mysql     networks:       atlassian-net:         aliases:           - confluence     volumes:       - ./data/confluence-data/confluence:/var/atlassian/confluence       - ./data/confluence-conf/confluence:/opt/atlassian/confluence networks:   atlassian-net:     driver: bridge 
 
设置 Mysql 权限 1 2 3 4 5 6 7 8 create  user  jira identified by  '123456' ;grant  all  privileges on  * .*  to  'jira' @'%'  identified by  '123456'  with  grant  option;grant  all  privileges on  * .*  to  'jira' @'localhost'  identified by  '123456'  with  grant  option;create  user  confluence identified by  '123456' ;grant  all  privileges on  * .*  to  'confluence' @'%'  identified by  '123456'  with  grant  option;grant  all  privileges on  * .*  to  'confluence' @'localhost'  identified by  '123456'  with  grant  option;flush privileges; 
 
设置 Mysql 字符集 1 2 3 4 show  variables like  'tx%' ;set  session transaction isolation level read committed;show  variables like  'tx%' ;SET  GLOBAL  tx_isolation= 'READ-COMMITTED' ;
 
修改 Jira 和 Confluence 配置 (根据自己机器配置合理配置) 由于 Jira 和 Confluence 默认配置内存都很小, 会导致机器资源利用不充分从而服务卡顿
编辑 /opt/atlassian/jira/bin/setenv.sh 添加或修改以下内容
1 2 JVM_MINIMUM_MEMORY="2048m"  JVM_MAXIMUM_MEMORY="4096m"  
 
编辑 /opt/atlassian/confluence/bin/setenv.sh 添加或修改一下内容
1 CATALINA_OPTS="-Xms2048m -Xmx4096m -XX:+UseG1GC ${CATALINA_OPTS} "  
 
Jira 和 Confluence 用户打通查看 atlassian 网关 IP
1 2 3 4 5 6 7 docker network ls NETWORK ID          NAME                DRIVER              SCOPE 454213449f23        atlassian-net       bridge              local  6c01b316db09        bridge              bridge              local  84b0dece1eb4        host                host                local  882cc15cbde0        none                null                local  
 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 docker inspect atlassian_default [     {         "Name" : "atlassian_default" ,         "Id" : "454213449f233d64c1fe1c2ab9041d6d9b4c22fa8f08a3b9641201da81bc7a4d" ,         "Created" : "2020-07-04T14:48:41.020085766Z" ,         "Scope" : "local" ,         "Driver" : "bridge" ,         "EnableIPv6" : false ,         "IPAM" : {             "Driver" : "default" ,             "Options" : null,             "Config" : [                 {                     "Subnet" : "192.168.32.0/20" ,                     "Gateway" : "192.168.32.1"                  }             ]         }         .... 
 
创建 Jira 用户服务器 
Confluence 配置 Jria 用户应用服务器
测试同步用户并调整优先级 
当创建用户之后, 只有用户登录了, 才会同步到 Confluence 服务器 
但是你创建的组, 必须要手动同步 
更新用户权限后, 必须要手动同步 
 
问题合集 连接测试失败, 来自服务器的响应 com.atlassian.crowd.exception.ApplicationPermissionException: Forbidden
连接测试失败。来自服务器的响应: com.atlassian.crowd.exception.ApplicationPermissionException: Forbidden (403) 加载页面时发生 “403 - Forbidden” 错误 client.forbidden.exception 转换到 Jira 主页
 
Unable to connect to JIRA for authentication - Forbidden 403  的 Resolution 就是答案
参考资料