├── .gitignore ├── .kitchen.yml ├── .rubocop.yml ├── .travis.yml ├── Berksfile ├── CHANGELOG.md ├── COMPATIBILITY.md ├── CONTRIBUTING.md ├── Gemfile ├── Guardfile ├── LICENSE ├── README.md ├── Rakefile ├── TESTING.md ├── VAGRANT.md ├── Vagrantfile ├── attributes └── default.rb ├── chefignore ├── files └── default │ └── tests │ └── minitest │ ├── apache2_test.rb │ ├── configuration_test.rb │ ├── default_test.rb │ ├── linux_installer_test.rb │ ├── support │ └── helpers.rb │ └── upgrade_test.rb ├── libraries └── jira.rb ├── metadata.rb ├── providers ├── jars.rb └── war.rb ├── recipes ├── apache2.rb ├── build_war.rb ├── configuration.rb ├── container_server_configuration.rb ├── container_server_jars.rb ├── database.rb ├── default.rb ├── installer.rb ├── standalone.rb ├── sysv.rb └── war.rb ├── resources ├── jars.rb └── war.rb ├── spec ├── apache2_spec.rb ├── build_war_spec.rb ├── configuration_spec.rb ├── container_server_configuration_spec.rb ├── container_server_jars_spec.rb ├── database_spec.rb ├── default_spec.rb ├── installer_spec.rb ├── spec_helper.rb ├── standalone_spec.rb ├── sysv_spec.rb └── war_spec.rb ├── templates └── default │ ├── dbconfig.xml.erb │ ├── jira-application.properties.erb │ ├── jira.init.erb │ ├── response.varfile.erb │ ├── tomcat │ ├── context.xml.erb │ ├── permgen.sh.erb │ ├── server.xml.erb │ ├── setenv.sh.erb │ └── web.xml.erb │ └── web_app.conf.erb └── test ├── .chef └── knife.rb ├── cookbooks └── jira_test │ ├── CHANGELOG.md │ ├── README.md │ ├── attributes │ └── default.rb │ ├── metadata.rb │ └── recipes │ └── default.rb └── support └── Gemfile.ci /.gitignore: -------------------------------------------------------------------------------- 1 | # Berkshelf 2 | Berksfile.lock 3 | /cookbooks 4 | 5 | # Bundler 6 | .bundle 7 | bin/ 8 | Gemfile.lock 9 | 10 | # Chef 11 | metadata.json 12 | tmp/ 13 | 14 | # Editors 15 | *~ 16 | *# 17 | .#* 18 | \#*# 19 | .*.sw[a-z] 20 | *.sublime-project 21 | *.sublime-workspace 22 | *.un~ 23 | 24 | # OS files 25 | .DS_Store 26 | 27 | # rbenv 28 | .ruby-version 29 | 30 | # Test Kitchen 31 | .kitchen/ 32 | .kitchen.local.yml 33 | 34 | # Vagrant 35 | .vagrant 36 | 37 | # vagrant-cache 38 | .cache 39 | -------------------------------------------------------------------------------- /.kitchen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | driver_plugin: vagrant 3 | 4 | driver_config: 5 | customize: 6 | memory: 1024 7 | 8 | platforms: 9 | - name: centos-6 10 | driver_config: 11 | box: opscode-centos-6.5 12 | box_url: http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box 13 | require_chef_omnibus: 11.8 14 | - name: ubuntu-12.04 15 | driver_config: 16 | box: opscode-ubuntu-12.04 17 | box_url: http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-12.04_chef-provisionerless.box 18 | require_chef_omnibus: 11.8 19 | 20 | suites: 21 | - name: default 22 | run_list: 23 | - recipe[minitest-handler] 24 | - recipe[jira_test] 25 | attributes: {} 26 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | AllCops: 2 | Include: 3 | - Berksfile 4 | - Gemfile 5 | - Guardfile 6 | - Rakefile 7 | Exclude: 8 | - test/**/* 9 | - vendor/**/* 10 | - ruby/**/* 11 | 12 | AlignParameters: 13 | Enabled: false 14 | Encoding: 15 | Enabled: false 16 | HashSyntax: 17 | Enabled: false 18 | LineLength: 19 | Enabled: false 20 | MethodLength: 21 | Max: 30 22 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | bundler_args: --without integration 3 | rvm: 4 | - 1.9.3 5 | before_script: 6 | - bundle exec berks install 7 | script: 8 | - bundle exec rake travis 9 | -------------------------------------------------------------------------------- /Berksfile: -------------------------------------------------------------------------------- 1 | site :opscode 2 | 3 | metadata 4 | 5 | cookbook 'mysql_connector', github: 'bflad/chef-mysql_connector' 6 | 7 | group :integration do 8 | cookbook 'java' 9 | cookbook 'tomcat' 10 | cookbook 'minitest-handler' 11 | cookbook 'jira_test', :path => 'test/cookbooks/jira_test' 12 | end 13 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 2.0.1 2 | 3 | * Bugfix: #8: Remove include_attribute from default attributes to prevent hard dependency on tomcat cookbook 4 | 5 | ## 2.0.0 6 | 7 | If you were using the default recipe, there are no changes you need to make for your environment to upgrade this cookbook. 8 | 9 | Major features are full support for standalone deployments and war building/deployments. Using ark where possible (its worked well for those using my Stash cookbook). 10 | 11 | I've removed the upgrade recipe in favor of using ark. If you'd like to keep old JIRA installations around (in case of upgrade issues, etc.), I would recommend switching to the standalone install_type since ark will automatically create versioned symlinks and you can easily revert `node['jira']['version']`. To convert install_type if install_path is the default (X.Y.Z being currently installed `node['jira']['version']`): 12 | * `service jira stop` 13 | * `mv /opt/atlassian/jira /opt/atlassian/jira-X.Y.Z` 14 | * `ln -s /opt/atlassian/jira-X.Y.Z /opt/atlassian/jira` 15 | * Set `node['jira']['install_type']` to standalone 16 | * Run Chef Client 17 | 18 | Other than that, migrated some recipes/templates and split out some recipes from the old linux_installer recipe, so ensure that if you're using a custom run list or template override for any nodes, that they include the new recipes/template location as necessary. 19 | 20 | Full details: 21 | * REMOVED: upgrade recipe and associated backup_* and *_backup attributes 22 | * MIGRATED: linux_installer -> installer recipe 23 | * MIGRATED: tomcat_configuration -> container_server_configuration recipe 24 | * MIGRATED: Tomcat templates into tomcat folder: 25 | * permgen.sh.erb -> tomcat/permgen.sh.erb 26 | * server.xml.erb -> tomcat/server.xml.erb 27 | * setenv.sh.erb -> tomcat/setenv.sh.erb 28 | * web.xml.erb -> tomcat/web.xml.erb 29 | * SPLIT: SysV init service configuration into sysv recipe and add init_type attribute 30 | * SPLIT: database jar deployment (mysql_connector_j, etc.) into container_server_jars recipe which also installs JIRA jars for war install_type 31 | * Bugfix: Use :create action instead of :create_if_missing for installer remote_file 32 | * Enhancement: Add standalone and war recipes and quite a few attributes for supporting those install_type's 33 | * Enhancement: Add build_war recipe 34 | * Enhancement: LWRPs for handling multiple instances of install, etc. 35 | * Enhancement: Bump default JIRA version to 6.1.5 36 | 37 | ## 1.7.0 38 | 39 | * Bump default JIRA version to 6.1 40 | 41 | ## 1.6.0 42 | 43 | * Bump default JIRA version to 6.0.7 44 | 45 | ## 1.5.0 46 | 47 | * Bump default JIRA version to 6.0.6 48 | 49 | ## 1.4.0 50 | 51 | * Initial Microsoft SQL Server support 52 | 53 | ## 1.3.0 54 | 55 | * Bump default JIRA version to 6.0.5 56 | 57 | ## 1.2.0 58 | 59 | * Bump default JIRA version to 6.0.2 60 | 61 | ## 1.1.0 62 | 63 | * Bump default JIRA version to 6.0.1 64 | 65 | ## 1.0.0 66 | 67 | * Split default recipe into individual recipes 68 | * apache2 recipe does not include default recipe 69 | * Load database/tomcat settings via Jira.settings library (bonus: help support Chef Solo) 70 | * Moved apache2 attributes into default attributes 71 | * Bump default JIRA version to 5.2.11 72 | * Added url_base attribute 73 | * Auto-detect checksum attribute for some versions 74 | * Added Vagrantfile and Test Kitchen for testing 75 | * minitest fixes 76 | * Added COMPATIBILITY.md 77 | * Refactored README documentation 78 | 79 | ## 0.1.3 80 | 81 | * Chef 11 fixes in apache2 recipe 82 | 83 | ## v0.1.2 84 | 85 | * Hopefully removed hard dependency on java_ark from java cookbook 86 | 87 | ## v0.1.1 88 | 89 | * Added permgen.sh template for custom JAVA_HOME, otherwise always defaults to 90 | JIRA installed JRE 91 | 92 | ## v0.1.0 93 | 94 | * Initial release 95 | -------------------------------------------------------------------------------- /COMPATIBILITY.md: -------------------------------------------------------------------------------- 1 | ## chef-jira Compatibility ## 2 | 3 | Cookbook compatibility based on platform, installation type (`node['jira']['install_type']`), architecture (`node['jira']['arch']`), and JIRA version (`node['jira']['version']`) 4 | 5 | ### Linux Installer x64 ### 6 | 7 | Cookbook Compatibility 8 | 9 | JIRA Version | CentOS 6 | RHEL 6 | Ubuntu 12.04 10 | -------------|----------|--------|------------- 11 | 5.2.X | 1.0+ | 1.0+ | 1.0+ 12 | 6.0.X | 1.0+ | 1.0+ | 1.0+ 13 | 14 | Test Matrix 15 | 16 | JIRA Version | CentOS 6 | RHEL 6 | Ubuntu 12.04 17 | -------------|----------|--------|------------- 18 | 5.2 | 1.0 | 1.0 | 1.0 19 | 6.0 | 1.1 | 1.1 | 1.1 20 | 21 | ### Linux Installer x32 ### 22 | 23 | Cookbook Compatibility 24 | 25 | JIRA Version | CentOS 6 | RHEL 6 | Ubuntu 12.04 26 | -------------|----------|--------|------------- 27 | 5.2.X | 1.0+ | 1.0+ | 1.0+ 28 | 6.0.X | 1.0+ | 1.0+ | 1.0+ 29 | 30 | Test Matrix 31 | 32 | JIRA Version | CentOS 6 | RHEL 6 | Ubuntu 12.04 33 | -------------|----------|--------|------------- 34 | 5.2 | - | - | - 35 | 6.0 | - | - | - 36 | 37 | ### Linux Standalone Install ### 38 | 39 | Cookbook Compatibility 40 | 41 | JIRA Version | CentOS 6 | RHEL 6 | Ubuntu 12.04 42 | -------------|----------|--------|------------- 43 | 5.2.X | 1.0+ | 1.0+ | 1.0+ 44 | 6.0.X | 1.0+ | 1.0+ | 1.0+ 45 | 46 | Test Matrix 47 | 48 | JIRA Version | CentOS 6 | RHEL 6 | Ubuntu 12.04 49 | -------------|----------|--------|------------- 50 | 5.2 | - | - | - 51 | 6.0 | - | - | - 52 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to @bflad Cookbooks 2 | 3 | Below is a modified version of Opscode's CONTRIBUTING.md in their public cookbooks. Thanks to them for the great documentation! 4 | 5 | ## Quick-contribute 6 | 7 | * Use the testing methods and tools outlined below 8 | * Use Github issues and pull requests when possible 9 | 10 | I regularly review contributions and will get back to you if I have 11 | any suggestions or concerns. 12 | 13 | ## The Apache License 14 | 15 | Licensing is very important to open source projects, it helps ensure 16 | the software continues to be available under the terms that the author 17 | desired. Chef uses the Apache 2.0 license to strike a balance between 18 | open contribution and allowing you to use the software however you 19 | would like to. 20 | 21 | The license tells you what rights you have that are provided by the 22 | copyright holder. It is important that the contributor fully 23 | understands what rights they are licensing and agrees to them. 24 | Sometimes the copyright holder isn't the contributor, most often when 25 | the contributor is doing work for a company. 26 | 27 | ## Using git 28 | 29 | You can get a quick copy of the repository for this cookbook by 30 | running `git clone 31 | git://github.com/bflad/chef-COOKBOOKNAME.git`. 32 | 33 | For collaboration purposes, it is best if you create a Github account 34 | and fork the repository to your own account. Once you do this you will 35 | be able to push your changes to your Github repository for others to 36 | see and use. 37 | 38 | If you have another repository in your GitHub account named the same 39 | as the cookbook, we suggest you suffix the repository with -cookbook. 40 | 41 | ### Branches and Commits 42 | 43 | You should submit your patch as a git branch named after the ticket, 44 | such as GH-1337. This is called a _topic branch_ and allows users to 45 | associate a branch of code with the ticket. 46 | 47 | It is a best practice to have your commit message have a _summary 48 | line_ that includes the ticket number, followed by an empty line and 49 | then a brief description of the commit. This also helps other 50 | contributors understand the purpose of changes to the code. 51 | 52 | [GH-1757] - platform_family and style 53 | 54 | * use platform_family for platform checking 55 | * update notifies syntax to "resource_type[resource_name]" instead of 56 | resources() lookup 57 | * GH-692 - delete config files dropped off by packages in conf.d 58 | * dropped debian 4 support because all other platforms have the same 59 | values, and it is older than "old stable" debian release 60 | 61 | Remember that not all users use Chef in the same way or on the same 62 | operating systems as you, so it is helpful to be clear about your use 63 | case and change so they can understand it even when it doesn't apply 64 | to them. 65 | 66 | ### Github and Pull Requests 67 | 68 | All of my open source cookbook projects are available on 69 | [Github](http://www.github.com/bflad). 70 | 71 | I don't require you to use Github, and I will even take patch diffs 72 | attached to issues. However Github has a lot of 73 | convenient features, such as being able to see a diff of changes 74 | between a pull request and the main repository quickly without 75 | downloading the branch. 76 | 77 | ### More information 78 | 79 | Additional help with git is available on the 80 | [Working with Git](http://wiki.opscode.com/display/chef/Working+with+Git) 81 | wiki page. 82 | 83 | ## Functional and Unit Tests 84 | 85 | This cookbook is set up to run tests under 86 | [Opscode's test-kitchen](https://github.com/opscode/test-kitchen). It 87 | uses minitest-chef to run integration tests after the node has been 88 | converged to verify that the state of the node. 89 | 90 | Test kitchen should run completely without exception using the default 91 | [baseboxes provided by Opscode](https://github.com/opscode/bento). 92 | Because Test Kitchen creates VirtualBox machines and runs through 93 | every configuration in the Kitchenfile, it may take some time for 94 | these tests to complete. 95 | 96 | If your changes are only for a specific recipe, run only its 97 | configuration with Test Kitchen. If you are adding a new recipe, or 98 | other functionality such as a LWRP or definition, please add 99 | appropriate tests and ensure they run with Test Kitchen. 100 | 101 | If any don't pass, investigate them before submitting your patch. 102 | 103 | Any new feature should have unit tests included with the patch with 104 | good code coverage to help protect it from future changes. Similarly, 105 | patches that fix a bug or regression should have a _regression test_. 106 | Simply put, this is a test that would fail without your patch but 107 | passes with it. The goal is to ensure this bug doesn't regress in the 108 | future. Consider a regular expression that doesn't match a certain 109 | pattern that it should, so you provide a patch and a test to ensure 110 | that the part of the code that uses this regular expression works as 111 | expected. Later another contributor may modify this regular expression 112 | in a way that breaks your use cases. The test you wrote will fail, 113 | signalling to them to research your ticket and use case and accounting 114 | for it. 115 | 116 | If you need help writing tests, please ask on the Chef Developer's 117 | mailing list, or the #chef-hacking IRC channel. 118 | 119 | ## Release Cycle 120 | 121 | The versioning for my projects is X.Y.Z and uses [Semantic Versioning](http://semver.org/). 122 | 123 | * X is a major release, which may not be fully compatible with prior 124 | major releases 125 | * Y is a minor release, which adds both new features and bug fixes 126 | * Z is a patch release, which adds just bug fixes 127 | 128 | ## Working with the community 129 | 130 | These resources will help you learn more about Chef and connect to 131 | other members of the Chef community: 132 | 133 | * [chef](http://lists.opscode.com/sympa/info/chef) and 134 | [chef-dev](http://lists.opscode.com/sympa/info/chef-dev) mailing 135 | lists 136 | * #chef and #chef-hacking IRC channels on irc.freenode.net 137 | * [Community Cookbook site](http://community.opscode.com) 138 | * [Chef wiki](http://wiki.opscode.com/display/chef) 139 | * Opscode Chef [product page](http://www.opscode.com/chef) 140 | 141 | ## Cookbook Contribution Do's and Don't's 142 | 143 | Please do include tests for your contribution. If you need help, ask 144 | on the 145 | [chef-dev mailing list](http://lists.opscode.com/sympa/info/chef-dev) 146 | or the 147 | [#chef-hacking IRC channel](http://community.opscode.com/chat/chef-hacking). 148 | Not all platforms that a cookbook supports may be supported by Test 149 | Kitchen. Please provide evidence of testing your contribution if it 150 | isn't trivial so we don't have to duplicate effort in testing. Chef 151 | 10.14+ "doc" formatted output is sufficient. 152 | 153 | Please do indicate new platform (families) or platform versions in the 154 | commit message, and update the relevant ticket. 155 | 156 | If a contribution adds new platforms or platform versions, indicate 157 | such in the body of the commit message(s). 158 | 159 | Please do use [foodcritic](http://acrmp.github.com/foodcritic) to 160 | lint-check the cookbook. Except FC007, it should pass all correctness 161 | rules. FC007 is okay as long as the dependent cookbooks are *required* 162 | for the default behavior of the cookbook, such as to support an 163 | uncommon platform, secondary recipe, etc. 164 | 165 | Please do ensure that your changes do not break or modify behavior for 166 | other platforms supported by the cookbook. For example if your changes 167 | are for Debian, make sure that they do not break on CentOS. 168 | 169 | Please do not modify the version number in the metadata.rb, Opscode 170 | will select the appropriate version based on the release cycle 171 | information above. 172 | 173 | Please do not update the CHANGELOG.md for a new version. Not all 174 | changes to a cookbook may be merged and released in the same versions. 175 | Opscode will update the CHANGELOG.md when releasing a new version of 176 | the cookbook. 177 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'rake' 4 | 5 | group :test, :integration do 6 | gem 'berkshelf', '~> 2.0.14' 7 | end 8 | 9 | group :test do 10 | gem 'chefspec', '~> 4.0' 11 | gem 'foodcritic', '~> 3.0.3' 12 | gem 'rubocop', '~> 0.23' 13 | end 14 | 15 | group :integration do 16 | gem 'busser-serverspec', '~> 0.2.6' 17 | gem 'kitchen-vagrant', '~> 0.14' 18 | gem 'test-kitchen', '~> 1.1' 19 | end 20 | 21 | # group :development do 22 | # gem 'guard', '~> 2.0' 23 | # gem 'guard-kitchen' 24 | # gem 'guard-rubocop', '~> 1.0' 25 | # gem 'guard-rspec', '~> 3.0' 26 | # gem 'rb-inotify', :require => false 27 | # gem 'rb-fsevent', :require => false 28 | # gem 'rb-fchange', :require => false 29 | # end 30 | -------------------------------------------------------------------------------- /Guardfile: -------------------------------------------------------------------------------- 1 | # A sample Guardfile 2 | # More info at https://github.com/guard/guard#readme 3 | 4 | # rubocop:disable RegexpLiteral 5 | guard 'kitchen' do 6 | watch(%r{test/.+}) 7 | watch(%r{^recipes/(.+)\.rb$}) 8 | watch(%r{^attributes/(.+)\.rb$}) 9 | watch(%r{^files/(.+)}) 10 | watch(%r{^templates/(.+)}) 11 | watch(%r{^providers/(.+)\.rb}) 12 | watch(%r{^resources/(.+)\.rb}) 13 | end 14 | # rubocop:enable RegexpLiteral 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Licensed under the Apache License, Version 2.0 (the "License"); 2 | you may not use this file except in compliance with the License. 3 | You may obtain a copy of the License at 4 | 5 | http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DEPRECATED chef-jira [![Build Status](https://secure.travis-ci.org/bflad/chef-jira.png?branch=master)](http://travis-ci.org/bflad/chef-jira) 2 | 3 | Please switch to using the community supported `jira` cookbook from the Chef SuperMarket: https://supermarket.chef.io/cookbooks/jira 4 | 5 | ## Description 6 | 7 | Installs/Configures Atlassian JIRA. Please see [COMPATIBILITY.md](COMPATIBILITY.md) for more information about JIRA releases that are tested and supported by this cookbook and its versions. 8 | 9 | ## Requirements 10 | 11 | ### Chef 12 | 13 | * Chef 11+ for version 2.0.0+ of this cookbook 14 | 15 | ### Platforms 16 | 17 | * CentOS 6 18 | * RHEL 6 19 | * Ubuntu 12.04 20 | 21 | ### Databases 22 | 23 | * Microsoft SQL Server 24 | * MySQL 25 | * Postgres 26 | 27 | ### Cookbooks 28 | 29 | Required [Opscode Cookbooks](https://github.com/opscode-cookbooks/) 30 | 31 | * [apache2](https://github.com/opscode-cookbooks/apache2) (if using apache2 recipe) 32 | * [ark](https://github.com/opscode-cookbooks/ark) 33 | * [database](https://github.com/opscode-cookbooks/database) (if using database recipe) 34 | * [mysql](https://github.com/opscode-cookbooks/mysql) (if using database recipe with MySQL) 35 | * [postgresql](https://github.com/opscode-cookbooks/postgresql) (if using database recipe with Postgres) 36 | 37 | Required Third-Party Cookbooks 38 | 39 | * [mysql_connector](https://github.com/bflad/chef-mysql_connector) (if using MySQL database) 40 | 41 | Suggested [Opscode Cookbooks](https://github.com/opscode-cookbooks/) 42 | 43 | * [java](https://github.com/opscode-cookbooks/java) 44 | * [tomcat](https://github.com/opscode-cookbooks/tomcat) 45 | 46 | ### JDK/JRE 47 | 48 | The Atlassian JIRA Linux installer will automatically configure a bundled JRE. If you wish to use your own JDK/JRE, with say the `java` cookbook, then as of this writing it must be Oracle and version 1.6 ([Supported Platforms](https://confluence.atlassian.com/display/JIRA/Supported+Platforms)) 49 | 50 | Necessary configuration with `java` cookbook: 51 | * `node['java']['install_flavor'] = "oracle"` 52 | * `node['java']['oracle']['accept_oracle_download_terms'] = true` 53 | * `recipe[java]` 54 | 55 | A /ht to [@seekely](https://github.com/seekely) for the [documentation nudge](https://github.com/bflad/chef-jira/issues/2). 56 | 57 | ## Attributes 58 | 59 | These attributes are under the `node['jira']` namespace. 60 | 61 | Attribute | Description | Type | Default 62 | ----------|-------------|------|-------- 63 | arch | architecture for JIRA installer - "x64" or "x32" | String | auto-detected (see attributes/default.rb) 64 | checksum | SHA256 checksum for JIRA install | String | auto-detected (see attributes/default.rb) 65 | context | URI context of installation (mainly for WAR installation) | String | auto-detected (see attributes/default.rb) 66 | context_path | Location of container server context configurations (for WAR installation) | String | auto-detected (see attributes/default.rb) 67 | home_path | home directory for JIRA | String | /var/atlassian/application-data/jira 68 | install_path | location to install JIRA | String | /opt/atlassian/jira 69 | install_type | JIRA install type - "installer", "standalone", "war" | String | installer 70 | init_type | JIRA init service type - "sysv" | String | sysv 71 | lib_path | location of container server libraries | String | auto-detected (see attributes/default.rb) 72 | url_base | URL base for JIRA install | String | http://www.atlassian.com/software/jira/downloads/binary/atlassian-jira 73 | url | URL for JIRA install | String | auto-detected (see attributes/default.rb) 74 | user | user running JIRA (jira for installer/standalone, container server user for WAR installation) | String | auto-detected (see attributes/default.rb) 75 | version | JIRA version to install | String | 6.1.5 76 | 77 | ### JIRA Build Attributes 78 | 79 | These attributes are under the `node['jira']['build']` namespace and used to control the JIRA WAR build process. 80 | 81 | Attribute | Description | Type | Default 82 | ----------|-------------|------|-------- 83 | targets | Ant targets for build process | String | war 84 | enable | Set to false to disable builds | Boolean | true 85 | exclude_jars | JARs to exclude from WAR | Array of Strings | `%w{jcl-over-slf4j jul-to-slf4j log4j slf4j-api slf4j-log4j12}` 86 | file | Output file from build | String | `#{node['jira']['install_path']}/dist-#{node['jira']['container_server']['name']}/atlassian-jira-#{node['jira']['version']}.war` 87 | 88 | ### JIRA Container Server Attributes 89 | 90 | These attributes are under the `node['jira']['container_server']` namespace. 91 | 92 | Attribute | Description | Type | Default 93 | ----------|-------------|------|-------- 94 | name | Container server running JIRA to configure | String | tomcat 95 | version | Version of container server | String | 6 96 | 97 | ### JIRA Database Attributes 98 | 99 | All of these `node['jira']['database']` attributes are overridden by `jira/jira` encrypted data bag (Hosted Chef) or data bag (Chef Solo), if it exists 100 | 101 | Attribute | Description | Type | Default 102 | ----------|-------------|------|-------- 103 | host | FQDN or "localhost" (localhost automatically installs `['database']['type']` server in default recipe) | String | localhost 104 | name | JIRA database name | String | jira 105 | password | JIRA database user password | String | changeit 106 | port | JIRA database port | Fixnum | 3306 107 | type | JIRA database type - "mssql", "mysql", or "postgresql" | String | mysql 108 | user | JIRA database user | String | jira 109 | 110 | ### JIRA JARs Attributes 111 | 112 | These attributes are under the `node['jira']['jars']` namespace and are for downloading/deploying JIRA JARs in WAR installations. 113 | 114 | Attribute | Description | Type | Default 115 | ----------|-------------|------|-------- 116 | deploy_jars | Which JIRA JARs to deploy to container server | Array of Strings | `%w{carol carol-properties hsqldb jcl-over-slf4j jonas_timer jotm jotm-iiops_stubs jotm-jmrp_stubs jta jul-to-slf4j log4j objectweb-datasource ots-jts slf4j-api slf4j-log4j12 xapool}` 117 | install_path | Location to install JIRA JARs | String | `node['jira']['install_path'] + '-jars'` 118 | url_base | Base URL to download JIRA JARs | String | http://www.atlassian.com/software/jira/downloads/binary/jira-jars 119 | url | URL to download JIRA JARs | String | `#{node['jira']['jars']['url_base']}-#{node['jira']['container_server']['name']}-distribution-#{node['jira']['jars']['version']}-#{node['jira']['container_server']['name']}-#{node['jira']['container_server']['version']}x.zip` 120 | version | Version of JIRA JARs to download/deploy | String | `node['jira']['version'].split('.')[0..1].join('.')` 121 | 122 | ### JIRA JVM Attributes 123 | 124 | These attributes are under the `node['jira']['jvm']` namespace. 125 | 126 | Attribute | Description | Type | Default 127 | ----------|-------------|------|-------- 128 | minimum_memory | JVM minimum memory | String | 512m 129 | maximum_memory | JVM maximum memory | String | 768m 130 | maximum_permgen | JVM maximum PermGen memory | String | 256m 131 | java_opts | additional JAVA_OPTS to be passed to JIRA JVM during startup | String | "" 132 | support_args | additional JAVA_OPTS recommended by Atlassian support for JIRA JVM during startup | String | "" 133 | 134 | ### JIRA Tomcat Attributes 135 | 136 | These attributes are under the `node['jira']['tomcat']` namespace. 137 | 138 | Any `node['jira']['tomcat']['key*']` attributes are overridden by `jira/jira` encrypted data bag (Hosted Chef) or data bag (Chef Solo), if it exists 139 | 140 | Attribute | Description | Type | Default 141 | ----------|-------------|------|-------- 142 | keyAlias | Tomcat SSL keystore alias | String | tomcat 143 | keystoreFile | Tomcat SSL keystore file - will automatically generate self-signed keystore file if left as default | String | `#{node['jira']['home_path']}/.keystore` 144 | keystorePass | Tomcat SSL keystore passphrase | String | changeit 145 | port | Tomcat HTTP port | Fixnum | 8080 146 | ssl_port | Tomcat HTTPS port | Fixnum | 8443 147 | 148 | ### JIRA WAR Attributes 149 | 150 | These attributes are under the `node['jira']['war']` namespace and used to control the JIRA WAR deploy process. 151 | 152 | Attribute | Description | Type | Default 153 | ----------|-------------|------|-------- 154 | file | Location of JIRA WAR file for deployment | String | `node['jira']['build']['file']` 155 | 156 | ## LWRPs 157 | 158 | * jira_jars: JIRA JARs download/deploy 159 | * jira_war: JIRA WAR download/build 160 | 161 | ### Getting Started 162 | 163 | Here's a quick example of downloading and building JIRA WAR: 164 | 165 | ```ruby 166 | # Download and build JIRA WAR 167 | jira_war node['jira']['install_path'] do 168 | action :build 169 | end 170 | ``` 171 | 172 | See full documentation for each LWRP and action below for more information. 173 | 174 | ### jira_jars 175 | 176 | Below are the available actions for the LWRP, default being `download`. 177 | 178 | #### deploy 179 | 180 | These attributes are associated with this LWRP action. 181 | 182 | Attribute | Description | Type | Default 183 | ----------|-------------|------|-------- 184 | deploy_jars | Which JARs to deploy | Array | `node['jira']['jars']['deploy_jars']` 185 | lib_path | Location of container server libraries | String | `node['jira']['lib_path']` 186 | 187 | Deploy custom list of JIRA JARs to custom location: 188 | 189 | ```ruby 190 | jira_jars '/opt/atlassian/jira-jars' do 191 | deploy_jars %w{carol carol-properties hsqldb jonas_timer jotm jotm-iiops_stubs jotm-jmrp_stubs jta objectweb-datasource ots-jts xapool} 192 | lib_path '/usr/local/my-special-snowflake-tomcat/lib/' 193 | action :deploy 194 | end 195 | ``` 196 | 197 | #### download 198 | 199 | These attributes are associated with this LWRP action. 200 | 201 | Attribute | Description | Type | Default 202 | ----------|-------------|------|-------- 203 | url | URL to download JIRA JARs | String | `node['jira']['jars']['url']` 204 | version | Version of JIRA JARS to download | String | `node['jira']['jars']['version']` 205 | 206 | Download custom version of JIRA JARs: 207 | 208 | ```ruby 209 | jira_jars '/opt/atlassian/jira-jars' do 210 | version '6.0' 211 | end 212 | ``` 213 | 214 | ### jira_war 215 | 216 | Below are the available actions for the LWRP, default being `download`. 217 | 218 | #### build 219 | 220 | These attributes are associated with this LWRP action. 221 | 222 | Attribute | Description | Type | Default 223 | ----------|-------------|------|-------- 224 | exclude_jars | JARs to exclude from built WAR | Array | `node['jira']['build']['exclude_jars']` 225 | file | Location of build output file | String | `node['jira']['build']['file']` 226 | targets | Ant targets for build | String | `node['jira']['build']['targets']` 227 | 228 | Run custom ant targets for JIRA WAR build: 229 | 230 | ```ruby 231 | jira_war '/opt/atlassian/jira' do 232 | targets 'generic' 233 | action :build 234 | end 235 | ``` 236 | 237 | #### download 238 | 239 | These attributes are associated with this LWRP action. 240 | 241 | Attribute | Description | Type | Default 242 | ----------|-------------|------|-------- 243 | checksum | Checksum of JIRA WAR download | String | `node['jira']['checksum']` 244 | url | URL to download JIRA WAR | String | `node['jira']['url']` 245 | version | Version of JIRA WAR to download | String | `node['jira']['version']` 246 | 247 | Download custom version of JIRA WAR: 248 | 249 | ```ruby 250 | jira_war '/opt/atlassian/jira' do 251 | version '6.1.4' 252 | end 253 | ``` 254 | 255 | ## Recipes 256 | 257 | * `recipe['jira']` 'Installs/configures Atlassian JIRA' 258 | * `recipe['jira::apache2']` 'Installs/configures Apache 2 as proxy (ports 80/443)' 259 | * `recipe['jira::build_war']` 'Builds JIRA WAR' 260 | * `recipe['jira::container_server_configuration']` 'Configures container server for JIRA deployment' 261 | * `recipe['jira::container_server_jars']` 'Deploys database/JIRA jars to container server' 262 | * `recipe['jira::database']` 'Installs/configures MySQL/Postgres server, database, and user for JIRA' 263 | * `recipe['jira::installer']` 'Installs/configures JIRA via installer' 264 | * `recipe['jira::standalone']` 'Installs/configures JIRA via standalone archive' 265 | * `recipe['jira::sysv']` 'Installs/configures JIRA SysV init service' 266 | * `recipe['jira::war']` 'Installs JIRA WAR' 267 | 268 | ## Usage 269 | 270 | ### JIRA Server Data Bag 271 | 272 | Optionally for securely overriding attributes on Hosted Chef, create a `jira/jira` encrypted data bag with the model below. Chef Solo can override the same attributes with a `jira/jira` unencrypted data bag of the same information. 273 | 274 | _required:_ 275 | * `['database']['type']` - "mssql", "mysql", or "postgresql" 276 | * `['database']['host']` - FQDN or "localhost" (localhost automatically installs `['database']['type']` server) 277 | * `['database']['name']` - Name of JIRA database 278 | * `['database']['user']` - JIRA database username 279 | * `['database']['password']` - JIRA database username password 280 | 281 | _optional:_ 282 | * `['database']['port']` - Database port, defaults to standard database port for `['database']['type']` 283 | * `['tomcat']['keyAlias']` - Tomcat HTTPS Java Keystore keyAlias, defaults to self-signed certifcate 284 | * `['tomcat']['keystoreFile']` - Tomcat HTTPS Java Keystore keystoreFile, 285 | defaults to self-signed certificate 286 | * `['tomcat']['keystorePass']` - Tomcat HTTPS Java Keystore keystorePass, defaults to self-signed certificate 287 | 288 | Repeat for other Chef environments as necessary. Example: 289 | 290 | { 291 | "id": "jira", 292 | "development": { 293 | "database": { 294 | "type": "postgresql", 295 | "host": "localhost", 296 | "name": "jira", 297 | "user": "jira", 298 | "password": "jira_db_password", 299 | }, 300 | "tomcat": { 301 | "keyAlias": "not_tomcat", 302 | "keystoreFile": "/etc/pki/java/wildcard_cert.jks", 303 | "keystorePass": "not_changeit" 304 | } 305 | } 306 | } 307 | 308 | ### Default JIRA Installation 309 | 310 | The simplest method is via the default recipe, which uses `node['jira']['install_type']` (defaults to installer). 311 | 312 | * Optionally (un)encrypted data bag or set attributes 313 | * `knife data bag create jira` 314 | * `knife data bag edit jira jira --secret-file=path/to/secret` 315 | * Add `recipe[jira]` to your node's run list. 316 | 317 | ### Standalone JIRA Installation 318 | 319 | Operates similarly to installer installation, however has added benefits of using `ark` to create version symlinks of each install. Easily can rollback upgrades by changing `node['jira']['version']`. 320 | 321 | * Optionally (un)encrypted data bag or set attributes 322 | * `knife data bag create jira` 323 | * `knife data bag edit jira jira --secret-file=path/to/secret` 324 | * Set `node['jira']['install_type']` to standalone 325 | * Add `recipe[jira]` to your node's run list. 326 | 327 | ### JIRA WAR Support 328 | 329 | There are three phases of JIRA WAR support: 330 | * Downloading JIRA WAR archive 331 | * Building JIRA WAR 332 | * Deploying JIRA WAR with necessary JAR dependencies and container server configuration 333 | 334 | Each of the phases can be handled separately as outlined below if you need to customize the WAR or deploy it to different nodes than where its being built. By default, cookbook will handle all three phases with `node['jira']['install_type']` set to war. 335 | 336 | #### Downloading JIRA WAR 337 | 338 | Handled by war recipe using `ark` so it'll save versioned symlinks. Location customizable by `node['jira']['install_path']`. From here, the WAR is ready to be customized and built. 339 | 340 | #### Building JIRA WAR 341 | 342 | Handled by build_war recipe and can be disabled by setting `node['jira']['build']['enabled']` to false. Customize build targets via `node['jira']['build']['targets']`. Expects build output to write file to `node['jira']['build']['file']` otherwise will build every convergence. Note `node['jira']['build']['exclude_jars']` will by default delete JARs that are recommended to be installed in container server lib directory (`node['jira']['lib_dir']`) from separate JIRA JARs download. 343 | 344 | While cookbook defaults to handling Tomcat build, you may be able to try and deploy the "generic" WAR. Set `node['jira']['container_server']['name']` to generic. 345 | 346 | #### Deploying JIRA WAR 347 | 348 | There are a couple pieces necessary for successful JIRA WAR deployment: 349 | * WAR file built and ready (`node['jira']['war']['file']`, which defaults to `node['jira']['build']['file']`) 350 | * Download and installation of JIRA JARs 351 | * Download and installation of database JARs (such as MySQL Connector/J, etc.) 352 | * Configuration of container server (such as Tomcat) 353 | 354 | Atlassian supports deploying WAR only on Tomcat 6/7 and the cookbook handles this case (recommended usage with Opscode Tomcat cookbook), however if you're feeling adventurous, this process may be workable for other container servers with some slight configuration and a wrapper cookbook. 355 | 356 | Cookbook handles the above steps with: 357 | * WAR file: built via build_war recipe (using jira_war LWRP) or location up to you with a wrapper cookbook and `node['jira']['war']['file']` set appropriately 358 | * JIRA JARs: container_server_jars recipe (using jira_jars LWRP) with configuration in `node['jira']['jars']` attributes and `node['jira']['install_type']` set to war 359 | * Database JARs: container_server_jars recipe and appropriate database type needing additional JARs 360 | * Configuration of container server: container_server_configuration recipe, which installs context to Tomcat if `node['jira']['container_server']['name']` is tomcat. 361 | 362 | ### Custom JIRA Configurations 363 | 364 | Using individual recipes, you can use this cookbook to configure JIRA to fit your environment. 365 | 366 | * Optionally (un)encrypted data bag or set attributes 367 | * `knife data bag create jira` 368 | * `knife data bag edit jira jira --secret-file=path/to/secret` 369 | * Add individual recipes to your node's run list. 370 | 371 | ## Testing and Development 372 | 373 | * Quickly testing with Vagrant: [VAGRANT.md](VAGRANT.md) 374 | * Full development and testing workflow with Test Kitchen and friends: [TESTING.md](TESTING.md) 375 | 376 | For Vagrant, you may need to add the following hosts entries: 377 | 378 | * 192.168.50.10 jira-centos-6 379 | * 192.168.50.10 jira-ubuntu-1204 380 | * (etc.) 381 | 382 | The running JIRA server is then accessible from the host machine: 383 | 384 | CentOS 6 Box: 385 | * Web UI (installer/standalone): https://jira-centos-6/ 386 | * Web UI (Tomcat deployed war): http://jira-centos-6:8080/jira/ 387 | 388 | Ubuntu 12.04 Box: 389 | * Web UI (installer/standalone): https://jira-ubuntu-1204/ 390 | * Web UI (Tomcat deployed war): http://jira-ubuntu-1204:8080/jira/ 391 | 392 | ## Contributing 393 | 394 | Please see contributing information in: [CONTRIBUTING.md](CONTRIBUTING.md) 395 | 396 | ## Maintainers 397 | 398 | * Brian Flad () 399 | 400 | ## License 401 | 402 | Please see licensing information in: [LICENSE](LICENSE) 403 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rake 2 | 3 | # Style tests. Rubocop and Foodcritic 4 | namespace :style do 5 | begin 6 | require 'rubocop/rake_task' 7 | desc 'Run Ruby style checks' 8 | RuboCop::RakeTask.new(:ruby) 9 | rescue LoadError 10 | puts '>>>>> Rubocop gem not loaded, omitting tasks' unless ENV['CI'] 11 | end 12 | 13 | begin 14 | require 'foodcritic' 15 | 16 | desc 'Run Chef style checks' 17 | FoodCritic::Rake::LintTask.new(:chef) do |t| 18 | t.options = { 19 | fail_tags: ['any'] 20 | } 21 | end 22 | rescue LoadError 23 | puts '>>>>> foodcritic gem not loaded, omitting tasks' unless ENV['CI'] 24 | end 25 | end 26 | 27 | desc 'Run all style checks' 28 | task style: ['style:chef', 'style:ruby'] 29 | 30 | # Integration tests. Kitchen.ci 31 | namespace :integration do 32 | begin 33 | require 'kitchen/rake_tasks' 34 | 35 | desc 'Run kitchen integration tests' 36 | Kitchen::RakeTasks.new 37 | rescue LoadError 38 | puts '>>>>> Kitchen gem not loaded, omitting tasks' unless ENV['CI'] 39 | end 40 | end 41 | 42 | # Unit tests with rspec/chefspec 43 | namespace :unit do 44 | begin 45 | require 'rspec/core/rake_task' 46 | desc 'Run unit tests with RSpec/ChefSpec' 47 | RSpec::Core::RakeTask.new(:rspec) do |t| 48 | t.rspec_opts = [].tap do |a| 49 | a.push('--color') 50 | a.push('--format progress') 51 | end.join(' ') 52 | end 53 | rescue LoadError 54 | puts '>>>>> rspec gem not loaded, omitting tasks' unless ENV['CI'] 55 | end 56 | end 57 | 58 | task unit: ['unit:rspec'] 59 | 60 | desc 'Run all tests on Travis' 61 | task travis: %w(style unit) 62 | 63 | # Default 64 | task default: ['style', 'unit', 'integration:kitchen:all'] 65 | -------------------------------------------------------------------------------- /TESTING.md: -------------------------------------------------------------------------------- 1 | This cookbook uses a variety of testing components: 2 | 3 | - Unit tests: [ChefSpec](https://github.com/acrmp/chefspec) 4 | - Integration tests: [Test Kitchen](https://github.com/opscode/test-kitchen) 5 | - Chef Style lints: [Foodcritic](https://github.com/acrmp/foodcritic) 6 | - Ruby Style lints: [Rubocop](https://github.com/bbatsov/rubocop) 7 | 8 | Prerequisites 9 | ------------- 10 | To develop on this cookbook, you must have a sane Ruby 1.9+ environment. Given the nature of this installation process (and it's variance across multiple operating systems), we will leave this installation process to the user. 11 | 12 | You must also have `bundler` installed: 13 | 14 | $ gem install bundler 15 | 16 | You must also have Vagrant and VirtualBox installed: 17 | 18 | - [Vagrant](https://vagrantup.com) 19 | - [VirtualBox](https://virtualbox.org) 20 | 21 | Once installed, you must install the `vagrant-berkshelf` plugin: 22 | 23 | $ vagrant plugin install vagrant-berkshelf 24 | 25 | Development 26 | ----------- 27 | 1. Clone the git repository from GitHub: 28 | 29 | $ git clone git@github.com:bflad/chef-COOKBOOK.git 30 | 31 | 2. Install the dependencies using bundler: 32 | 33 | $ bundle install 34 | 35 | 3. Create a branch for your changes: 36 | 37 | $ git checkout -b my_bug_fix 38 | 39 | 4. Make any changes 40 | 5. Write tests to support those changes. It is highly recommended you write both unit and integration tests. 41 | 6. Run the tests: 42 | - `bundle exec rspec` 43 | - `bundle exec foodcritic .` 44 | - `bundle exec rubocop` 45 | - `bundle exec kitchen test` 46 | 47 | 7. Assuming the tests pass, open a Pull Request on GitHub 48 | -------------------------------------------------------------------------------- /VAGRANT.md: -------------------------------------------------------------------------------- 1 | Here's how you can quickly get testing or developing against the cookbook thanks to [Vagrant](http://vagrantup.com/) and [Berkshelf](http://berkshelf.com/). 2 | 3 | vagrant plugin install vagrant-berkshelf 4 | vagrant plugin install vagrant-cachier 5 | vagrant plugin install vagrant-omnibus 6 | git clone git://github.com/bflad/chef-COOKBOOK.git 7 | cd chef-COOKBOOK 8 | vagrant up BOX # BOX being centos5, centos6, debian7, fedora18, fedora19, fedora20, freebsd9, ubuntu1204, ubuntu1210, ubuntu1304, or ubuntu1310 9 | 10 | You can then SSH into the running VM using the `vagrant ssh BOX` command. 11 | 12 | The VM can easily be stopped and deleted with the `vagrant destroy` command. Please see the official [Vagrant documentation](http://docs.vagrantup.com/v2/cli/index.html) for a more in depth explanation of available commands. 13 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # Base hostname 2 | cookbook = 'jira' 3 | 4 | Vagrant.configure('2') do |config| 5 | config.berkshelf.enabled = true 6 | config.cache.auto_detect = true 7 | config.omnibus.chef_version = :latest 8 | 9 | config.vm.define :centos5 do |centos5| 10 | centos5.vm.box = 'opscode-centos-5.10' 11 | centos5.vm.box_url = 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-5.10_chef-provisionerless.box' 12 | centos5.vm.hostname = "#{cookbook}-centos-5" 13 | end 14 | 15 | config.vm.define :centos6 do |centos6| 16 | centos6.vm.box = 'opscode-centos-6.5' 17 | centos6.vm.box_url = 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box' 18 | centos6.vm.hostname = "#{cookbook}-centos-6" 19 | end 20 | 21 | config.vm.define :debian7 do |debian7| 22 | debian7.vm.box = 'opscode-debian-7.2.0' 23 | debian7.vm.box_url = 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-7.2.0_chef-provisionerless.box' 24 | debian7.vm.hostname = "#{cookbook}-debian-7" 25 | end 26 | 27 | config.vm.define :fedora18 do |fedora18| 28 | fedora18.vm.box = 'opscode-fedora-18' 29 | fedora18.vm.box_url = 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_fedora-18_chef-provisionerless.box' 30 | fedora18.vm.hostname = "#{cookbook}-fedora-18" 31 | end 32 | 33 | config.vm.define :fedora19 do |fedora19| 34 | fedora19.vm.box = 'opscode-fedora-19' 35 | fedora19.vm.box_url = 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_fedora-19_chef-provisionerless.box' 36 | fedora19.vm.hostname = "#{cookbook}-fedora-19" 37 | end 38 | 39 | config.vm.define :fedora20 do |fedora20| 40 | fedora20.vm.box = 'opscode-fedora-20' 41 | fedora20.vm.box_url = 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_fedora-20_chef-provisionerless.box' 42 | fedora20.vm.hostname = "#{cookbook}-fedora-20" 43 | end 44 | 45 | config.vm.define :freebsd9 do |freebsd9| 46 | freebsd9.vm.box = 'opscode-freebsd-9.2' 47 | freebsd9.vm.box_url = 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_freebsd-9.2_chef-provisionerless.box' 48 | freebsd9.vm.hostname = "#{cookbook}-freebsd-9" 49 | end 50 | 51 | config.vm.define :ubuntu1204 do |ubuntu1204| 52 | ubuntu1204.vm.box = 'opscode-ubuntu-12.04' 53 | ubuntu1204.vm.box_url = 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-12.04_chef-provisionerless.box' 54 | ubuntu1204.vm.hostname = "#{cookbook}-ubuntu-1204" 55 | end 56 | 57 | config.vm.define :ubuntu1210 do |ubuntu1210| 58 | ubuntu1210.vm.box = 'opscode-ubuntu-12.10' 59 | ubuntu1210.vm.box_url = 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-12.10_chef-provisionerless.box' 60 | ubuntu1210.vm.hostname = "#{cookbook}-ubuntu-1210" 61 | end 62 | 63 | config.vm.define :ubuntu1304 do |ubuntu1304| 64 | ubuntu1304.vm.box = 'opscode-ubuntu-13.04' 65 | ubuntu1304.vm.box_url = 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-13.04_chef-provisionerless.box' 66 | ubuntu1304.vm.hostname = "#{cookbook}-ubuntu-1304" 67 | end 68 | 69 | config.vm.define :ubuntu1310 do |ubuntu1310| 70 | ubuntu1310.vm.box = 'opscode-ubuntu-13.10' 71 | ubuntu1310.vm.box_url = 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-13.10_chef-provisionerless.box' 72 | ubuntu1310.vm.hostname = "#{cookbook}-ubuntu-1310" 73 | end 74 | 75 | config.vm.network :private_network, ip: '192.168.50.10' 76 | 77 | config.vm.provider 'virtualbox' do |v| 78 | v.customize ['modifyvm', :id, '--memory', 2048] 79 | end 80 | 81 | config.vm.provision :chef_solo do |chef| 82 | chef.log_level = :debug 83 | chef.json = { 84 | 'java' => { 85 | 'install_flavor' => 'oracle', 86 | 'oracle' => { 87 | 'accept_oracle_download_terms' => true 88 | } 89 | }, 90 | 'jira' => { 91 | 'install_type' => 'war' 92 | }, 93 | 'mysql' => { 94 | 'bind_address' => '0.0.0.0', 95 | 'server_root_password' => 'iloverandompasswordsbutthiswilldo', 96 | 'server_repl_password' => 'iloverandompasswordsbutthiswilldo', 97 | 'server_debian_password' => 'iloverandompasswordsbutthiswilldo' 98 | }, 99 | 'tomcat' => { 100 | 'java_options' => '-XX:MaxPermSize=256M -Xmx768M -Djava.awt.headless=true', 101 | 'keystore_password' => 'iloverandompasswordsbutthiswilldo', 102 | 'truststore_password' => 'iloverandompasswordsbutthiswilldo' 103 | } 104 | } 105 | 106 | chef.run_list = [ 107 | 'recipe[java]', 108 | 'recipe[tomcat]', 109 | "recipe[#{cookbook}]" 110 | ] 111 | end 112 | end 113 | -------------------------------------------------------------------------------- /attributes/default.rb: -------------------------------------------------------------------------------- 1 | default['jira']['home_path'] = '/var/atlassian/application-data/jira' 2 | default['jira']['init_type'] = 'sysv' 3 | default['jira']['install_path'] = '/opt/atlassian/jira' 4 | default['jira']['install_type'] = 'installer' 5 | default['jira']['url_base'] = 'http://www.atlassian.com/software/jira/downloads/binary/atlassian-jira' 6 | default['jira']['version'] = '6.1.5' 7 | 8 | if node['kernel']['machine'] == 'x86_64' 9 | default['jira']['arch'] = 'x64' 10 | else 11 | default['jira']['arch'] = 'x32' 12 | end 13 | 14 | # rubocop:disable BlockNesting 15 | case node['platform_family'] 16 | when 'windows' 17 | case node['jira']['install_type'] 18 | when 'installer' 19 | default['jira']['url'] = "#{node['jira']['url_base']}-#{node['jira']['version']}-#{node['jira']['arch']}.exe" 20 | default['jira']['checksum'] = 21 | case node['jira']['version'] 22 | when '5.2' then node['jira']['arch'] == 'x64' ? '55161ba22f51b168fc33e751851de099911b5f648b02c43d77b37ed4f3d88586' : '9d57ecb6d487754b965a0ffed8b644122fef500af0c068ddb755a4685df21ca4' 23 | when '5.2.11' then node['jira']['arch'] == 'x64' ? 'a3ac923ff8563d178853222f4ebf246f78af6d1e1f4ea503b3b6443ecbdc9258' : '336297395d6cb0f0b80503bb88e545f441608a31d9af492b27fa4e4045e04c0f' 24 | when '6.0' then node['jira']['arch'] == 'x64' ? '971f0d6242eb8aa02e47b086428d1f1fe46ea6c7a0859412303be2cc909487c7' : '0d7e6dc83e4fbca5b5ec5a62d40ac18c6b81d9dda470251e954a0035bee328e6' 25 | when '6.0.1' then node['jira']['arch'] == 'x64' ? '47f0e16cdce30900135e425e978359db13fb5b913d8c8aadcfa7e6b4870c30c2' : '651b5bac996575c153e0dd2310a390b403aa28bd0c3a0d197dcdf5772155df65' 26 | when '6.0.2' then node['jira']['arch'] == 'x64' ? '34f462e24dc9dea5a413d6a287b513624dec4a6e8ad37240a7dd586e43c6402f' : '8b286e809c42bb80c5a98bc9440cfabb219ec01bbdd895005e866941ea5662e0' 27 | when '6.0.3' then node['jira']['arch'] == 'x64' ? 'a50ba6428c8692948a26ff1098538f7c4968b9b55d801d6a810b6a80228ad1d8' : '819626e6882dd2fd3aa763d1ae765783a34a20e51fb71d6b0438b05729b9541d' 28 | when '6.0.4' then node['jira']['arch'] == 'x64' ? '8a990fa09cb8c7952195a0adb3a1139cfce3f4a59ed0c97bf9d693091ec3dd6e' : '24067f9cc9629e4abc69d53be870c91a40246dd15c8313464053c02b548dbcbc' 29 | when '6.0.5' then node['jira']['arch'] == 'x64' ? '470de9a8a3f14c9cf5cde0b950c7cdfc4019c9cb55f1566ada136a2b8737a7c5' : '565385605da0fa5e4158e1e42cedcb2bda3a40f18732594f077a7a921ac86354' 30 | when '6.0.6' then node['jira']['arch'] == 'x64' ? '0c62209c7564b64b6cbd176804169959df13817a8d2e0285583ba35bc4131541' : '95e692b444b97c69c18326318d76b3452aaa04b6a4883a16aa14ef84adb03c29' 31 | when '6.0.7' then node['jira']['arch'] == 'x64' ? '48eb2264ddc48b03edd2b0c3f26f2de2cb281e76e1892e8fb62cb015556a8943' : 'fcd6b1621cf64bd0668b978e51092ec787773f842b8124472a01c96b2e67cb7b' 32 | when '6.0.8' then node['jira']['arch'] == 'x64' ? 'a3fefd20ba4b14bb6d99877f645439f8f392adc819bea8b34b2f668c110fa3c5' : 'f6ea152b9bdf7eb834a7c467e52a1cc42225d8b9e2c35a0b6248d6eac31068be' 33 | when '6.1' then node['jira']['arch'] == 'x64' ? '4bae29a79cc76b6845be5149bfa18a82918a0bfcfa7bd621514bc73cdfa7690f' : 'c484ffcb4f9fb14e490273d655f6659bcf8de3b0b74439245408099bc32b70ac' 34 | when '6.1.5' then node['jira']['arch'] == 'x64' ? 'c0f5f69cc7ba5251619f4bfa104849e97d853926439b813c9393f8927e984aa8' : '4459df620be50ddaa85ca7fa8ab7e62bac175da7dd02687483f2a338b407b27c' 35 | end 36 | when 'standalone' 37 | default['jira']['url'] = "#{node['jira']['url_base']}-#{node['jira']['version']}.zip" 38 | default['jira']['checksum'] = 39 | case node['jira']['version'] 40 | when '5.2' then 'a8ef62077f87d9f22d60c3e558436b11cf5e8664d4a417f622a33257d46ba3f1' 41 | when '5.2.11' then '7ea1a106e9d70f6d9a53a4c7d49a975cdfeadbae75f6452542e192c897f1faf0' 42 | when '6.0' then 'bdd47d3e30827e445288faf211992d7e96170ebae11e2451cc0362afe8de6ab1' 43 | when '6.0.1' then '367dcb92f2e006cda86997b363f0835d3bfd75d4492404c1a496aad1251bdf9b' 44 | when '6.0.2' then '702d0e67fce623de9d7c3da880d7b6dc810faa5e10ae63b6189d10d01e708fbe' 45 | when '6.0.3' then '3c917b8c828c54785b4dec36a073a9c587ed71669ff5c6e792d7f6f3ac338bb6' 46 | when '6.0.4' then '39e89c69f539c0e0404ebeffa40fc784129a221ca2a1c2da535691b865d706a9' 47 | when '6.0.5' then '2ce8e65247dbb5d09e3b7f54e9ee827459229c2d52b73ec60ee8c2e557b6127b' 48 | when '6.0.6' then '9d037c9666cfb606308be3af1f70447db978ecbe8032f0d0961cbcad2b848b79' 49 | when '6.0.7' then '4bc901c9e6d01291936cd2c1de9692582edfbc476ec256865cc37e936813e899' 50 | when '6.0.8' then '410d77cb66f9a3972609a41f407ca2dc5bfaee41c477f4b06f90a9588f9546f2' 51 | when '6.1' then '51131e1c7a453468b14dccf86560b8e023dc840fdc9f44a88a89793ca76cd54f' 52 | when '6.1.5' then '4a61d498529e1f3dcbd490de7b63d802fef61336632cf8cb46f865b8bf0f34e5' 53 | end 54 | when 'war' 55 | default['jira']['url'] = "#{node['jira']['url_base']}-#{node['jira']['version']}-war.zip" 56 | default['jira']['checksum'] = 57 | case node['jira']['version'] 58 | when '5.2' then 'e3ef2c555accfa40399b287a46c7ffd75b3d87d9a691b33e2b9cd359f7a3d433' 59 | when '5.2.11' then 'b372a1c1e7f7983a3413adcaa0f027b03c6f986cc5c7d833f52488350dc65c93' 60 | when '6.0' then '6a46035d2fd9b9425df631d2fdeca13ab2e36814de30a3a50b88a234eabd3f66' 61 | when '6.0.1' then 'd6b63f05d5ce2530592e5e174411a9a5104007e92a84a3f032f73526efabb10f' 62 | when '6.0.2' then 'f8060b1dfc059025652bbc87d5f2440012024aa97b018cf269410ac5866f5b6c' 63 | when '6.0.3' then '768b73d58fac78b83495cc6918c28e60d68417f4a6d2ceb70ccc7927f8cff6b5' 64 | when '6.0.4' then '8214851759cd5b6034d5064c4f181bc36eaeaa54421d3206a49c42d0ef55640f' 65 | when '6.0.5' then '55f06fae0525291b18e65da2c82a26aa2f4d300f6830fd08554eab89b5081e07' 66 | when '6.0.6' then '54f516dc835d7e4f99409ebf39095960273b45dec98f86c5dc6923eb5cc8f258' 67 | when '6.0.7' then 'ea1a60a2585dcb97ddf0e9dc0c4755e842bed40b2ae11ac0e9044412b4bae6b0' 68 | when '6.0.8' then '82b92df5337a7f0fd4c8aa95a56594b675050f3b066a8dec0563dccebe15fd30' 69 | when '6.1' then '2377e4c3546760773d8e2f9d22d5d7bafd05980bf27b8f6d22a7126863d9da9a' 70 | when '6.1.5' then '4f754a1da16fcb26154e8f7331525d155e4953551aa132e8b9c0acf6f1bc65b7' 71 | end 72 | end 73 | else 74 | case node['jira']['install_type'] 75 | when 'installer' 76 | default['jira']['url'] = "#{node['jira']['url_base']}-#{node['jira']['version']}-#{node['jira']['arch']}.bin" 77 | default['jira']['checksum'] = 78 | case node['jira']['version'] 79 | when '5.2' then node['jira']['arch'] == 'x64' ? '95841d1b222db63c5653b81583837a5d90e315a2ff2661534b310113afcff33f' : '05335145554cc446adfb90e318139f9408b41cacb57d90d0e11b788718ed8734' 80 | when '5.2.11' then node['jira']['arch'] == 'x64' ? 'ad4a851e7dedd6caf3ab587c34155c3ea68f8e6b878b75a3624662422966dff4' : '7088a7d123e263c96ff731d61512c62aef4702fe92ad91432dc060bab5097cb7' 81 | when '6.0' then node['jira']['arch'] == 'x64' ? '915b773c9870ebacbee4712e26d1c9539b48210b6055cb1b2d81e662deae2e60' : '3967f8f663c24ff51bf30300ae0f2fb27320c9b356ed4dbf78fce7cc1238eccb' 82 | when '6.0.1' then node['jira']['arch'] == 'x64' ? '4e56ef7980b8f3b5b434a7a440d663b9d08e5588d635214e4434eabc3a8d9623' : 'e383961667e6ef6b5bc387123fa76620a5bdf71413283de5b79cd0ae71248922' 83 | when '6.0.2' then node['jira']['arch'] == 'x64' ? 'fee8fe6804ace532abb805eea5ae0df342526eaf45b2c3e8e34978c97b5aa3aa' : 'bfa7d8731ef2ec5b7e802c119d5a68b1b93505d904c831801236eacff9fa1f5e' 84 | when '6.0.3' then node['jira']['arch'] == 'x64' ? 'cdbd679e70097120c0083e9e0949c66b842742a3a4ccbae0db01b81d9e9fce9e' : 'cda9499247c43c0f812bd2924e569ba3dd08c088e03455ec9c1f79bd30c1509a' 85 | when '6.0.4' then node['jira']['arch'] == 'x64' ? 'd7b845cb21461f032e1563e40f7daa220277809c53e14e4342728f04d0fa039a' : '4f60c69a13d3d66b0864849d9d3d5a8dfe240830b332cdd8848ae14055709984' 86 | when '6.0.5' then node['jira']['arch'] == 'x64' ? '0826bf54c7765b053e571d3118b8b48f899d60a76518dc4df34da14a66930e37' : '10f9cc9ebb702f01d44f315eabfa4bc1af75dadf161a2cf6d5439c720d604fed' 87 | when '6.0.6' then node['jira']['arch'] == 'x64' ? 'bf7145fbbbe0446f3a349e85b7b1277cab3cbe1dfc85029a2fb974f8fac3be59' : '030f25f6ab565d66b9f390dced8cafafe0d338ea792d942a6d1901888fa91b7d' 88 | when '6.0.7' then node['jira']['arch'] == 'x64' ? '89da53718d80aad4680e48559ff126ffb35addccfed556c022d5450fb8e44cbb' : '159f143a1d15c9764b05f0b07f5ea24e4afe851f276ba5290eadabcf5f404a53' 89 | when '6.0.8' then node['jira']['arch'] == 'x64' ? 'b7d14d74247272056316ae89d5496057b4192fb3c2b78d3aab091b7ba59ca7aa' : 'ad1d17007314cf43d123c2c9c835e03c25cd8809491a466ff3425d1922d44dc0' 90 | when '6.1' then node['jira']['arch'] == 'x64' ? '72e49cc770cc2a1078dd60ad11329508d6815582424d16836efd873f3957e2c8' : 'c879e0c4ba5f508b4df0deb7e8f9baf3b39db5d7373eac3b20076c6f6ead6e84' 91 | when '6.1.5' then node['jira']['arch'] == 'x64' ? 'b0b67b77c6c1d96f4225ab3c22f31496f356491538db1ee143eca0a58de07f78' : 'f3e589fa34182195902dcb724d82776005a975df55406b4bd5864613ca325d97' 92 | end 93 | when 'standalone' 94 | default['jira']['url'] = "#{node['jira']['url_base']}-#{node['jira']['version']}.tar.gz" 95 | default['jira']['checksum'] = 96 | case node['jira']['version'] 97 | when '5.2' then '80e05e65778ce2e3d91422da9d30a547e174fe2b9ba920b7dcdff78e29f353da' 98 | when '5.2.11' then '8d18b1da9487c1502efafacc441ad9a9dc55219a2838a1f02800b8a9a9b3d194' 99 | when '6.0' then '791a8a4a65e40cd00c1ee2a3207935fbcc2c103416e739ad4e3ed29e39372383' 100 | when '6.0.1' then '492e46119310f378d7944dea0a92c470f0d0b794219d6647a92ea08f8e99f80e' 101 | when '6.0.2' then '89b0178bf33488040c032d678ffcdeebc9b9d4565599a31b35515e3aaa391667' 102 | when '6.0.3' then '0f94b9d31b8825e91c05e06538dce5891801b83549adbc1dfd26f5b9100c24cf' 103 | when '6.0.4' then 'ca0f80c36ab408131e283b5c00aead949ce37c4ef8a870b2726eb55882ea6821' 104 | when '6.0.5' then '9050297a28059468a9a3ddfcc8b788aaf62210b341f547d4aebbab92baa96dd3' 105 | when '6.0.6' then '27e699692e107a9790926d5f6fb0ddb89a1bd70e1d6877ce23991c0701495d67' 106 | when '6.0.7' then '6de5ac1a06116de2c95d5944eab1da416170e8b6bea3a0a7a641b52836100946' 107 | when '6.0.8' then '2ca0eb656a348c43b7b9e84f7029a7e0eed27eea9001f34b89bbda492a101cb6' 108 | when '6.1' then 'e63821f059915074ff866993eb5c2f452d24a0a2d3cf0dccea60810c8b3063a0' 109 | when '6.1.5' then '6e72f3820b279ec539e5c12ebabed13bb239f49ba38bb2e70a40d36cb2a7d68f' 110 | end 111 | when 'war' 112 | default['jira']['url'] = "#{node['jira']['url_base']}-#{node['jira']['version']}-war.tar.gz" 113 | default['jira']['checksum'] = 114 | case node['jira']['version'] 115 | when '5.2' then '521f0f60500b8f9e1700af3024e5d51a378e3a63a3c6173a66ae298ddadb3d4b' 116 | when '5.2.11' then '11e34312389362260af26b95aa83a4d3c43705e56610f0f691ceaf46e908df6a' 117 | when '6.0' then '53583c56e6697201813eca07ca87c0d2010359f68d29f6b20b09d1ecad8c185b' 118 | when '6.0.1' then '525f62eee680e3a0f6e602dbb8c9ed83b7e17c730009530dd1a88f175e2bed85' 119 | when '6.0.2' then '083d055b86b86df485829d4d8848a4354818b4ee410aff8c9c3bfa300de61f9a' 120 | when '6.0.3' then 'e1038bfba3365ccd85d1ba86bb9c5c36591d56637e5f9acab9fa01654386c588' 121 | when '6.0.4' then 'f994ed71ea29764187a1cb1eb12d726182cd404d0a77dfb585ad70789d75e80f' 122 | when '6.0.5' then '4a7eda7da278be778add316bd783a5564ae931f7d77ad6078217dd3d8b49f595' 123 | when '6.0.6' then 'd6ce6bfe41275887cf6004827916b43d29a9c1b8a1b2029c18d9a4e54c9b199b' 124 | when '6.0.7' then 'd75d798021038584a8f987142ac161c2d467329a430a3573538d8600d8805005' 125 | when '6.0.8' then '4bcee56a7537a12e9eeec7a9573f59fd37d6a631c5893152662bef2daa54869d' 126 | when '6.1' then '7beb69e3b66560b696a3c6118b79962614d17cd26f9ff6df626380679c848d29' 127 | when '6.1.5' then 'a6e6dfb42e01f57263d070d27fb7f66110a6fe7395c7ec6199784d2458ca661c' 128 | end 129 | end 130 | end 131 | # rubocop:enable BlockNesting 132 | 133 | default['jira']['apache2']['access_log'] = '' 134 | default['jira']['apache2']['error_log'] = '' 135 | default['jira']['apache2']['port'] = 80 136 | default['jira']['apache2']['virtual_host_alias'] = node['fqdn'] 137 | default['jira']['apache2']['virtual_host_name'] = node['hostname'] 138 | 139 | default['jira']['apache2']['ssl']['access_log'] = '' 140 | default['jira']['apache2']['ssl']['chain_file'] = '' 141 | default['jira']['apache2']['ssl']['error_log'] = '' 142 | default['jira']['apache2']['ssl']['port'] = 443 143 | 144 | case node['platform_family'] 145 | when 'rhel' 146 | default['jira']['apache2']['ssl']['certificate_file'] = '/etc/pki/tls/certs/localhost.crt' 147 | default['jira']['apache2']['ssl']['key_file'] = '/etc/pki/tls/private/localhost.key' 148 | else 149 | default['jira']['apache2']['ssl']['certificate_file'] = '/etc/ssl/certs/ssl-cert-snakeoil.pem' 150 | default['jira']['apache2']['ssl']['key_file'] = '/etc/ssl/private/ssl-cert-snakeoil.key' 151 | end 152 | 153 | default['jira']['container_server']['name'] = 'tomcat' 154 | default['jira']['container_server']['version'] = '6' 155 | 156 | default['jira']['build']['targets'] = 'war' 157 | default['jira']['build']['enable'] = true 158 | default['jira']['build']['exclude_jars'] = %w(jcl-over-slf4j jul-to-slf4j log4j slf4j-api slf4j-log4j12) 159 | default['jira']['build']['file'] = "#{node['jira']['install_path']}/dist-#{node['jira']['container_server']['name']}/atlassian-jira-#{node['jira']['version']}.war" 160 | 161 | default['jira']['database']['host'] = 'localhost' 162 | default['jira']['database']['name'] = 'jira' 163 | default['jira']['database']['password'] = 'changeit' 164 | default['jira']['database']['port'] = 3306 165 | default['jira']['database']['type'] = 'mysql' 166 | default['jira']['database']['user'] = 'jira' 167 | 168 | default['jira']['jars']['deploy_jars'] = %w(carol carol-properties hsqldb jcl-over-slf4j jonas_timer jotm jotm-iiops_stubs jotm-jmrp_stubs jta jul-to-slf4j log4j objectweb-datasource ots-jts slf4j-api slf4j-log4j12 xapool) 169 | default['jira']['jars']['install_path'] = node['jira']['install_path'] + '-jars' 170 | default['jira']['jars']['url_base'] = 'http://www.atlassian.com/software/jira/downloads/binary/jira-jars' 171 | default['jira']['jars']['version'] = node['jira']['version'].split('.')[0..1].join('.') 172 | default['jira']['jars']['url'] = "#{node['jira']['jars']['url_base']}-#{node['jira']['container_server']['name']}-distribution-#{node['jira']['jars']['version']}-#{node['jira']['container_server']['name']}-#{node['jira']['container_server']['version']}x.zip" 173 | 174 | default['jira']['jvm']['minimum_memory'] = '256m' 175 | default['jira']['jvm']['maximum_memory'] = '768m' 176 | default['jira']['jvm']['maximum_permgen'] = '256m' 177 | default['jira']['jvm']['java_opts'] = '' 178 | default['jira']['jvm']['support_args'] = '' 179 | 180 | default['jira']['tomcat']['keyAlias'] = 'tomcat' 181 | default['jira']['tomcat']['keystoreFile'] = "#{node['jira']['home_path']}/.keystore" 182 | default['jira']['tomcat']['keystorePass'] = 'changeit' 183 | default['jira']['tomcat']['port'] = '8080' 184 | default['jira']['tomcat']['ssl_port'] = '8443' 185 | 186 | default['jira']['war']['file'] = node['jira']['build']['file'] 187 | 188 | case node['jira']['container_server']['name'] 189 | when 'tomcat' 190 | if node['jira']['install_type'] == 'war' 191 | default['jira']['context'] = 'jira' 192 | begin 193 | default['jira']['context_path'] = node['tomcat']['context_dir'] 194 | default['jira']['lib_path'] = node['tomcat']['lib_dir'] 195 | default['jira']['user'] = node['tomcat']['user'] 196 | rescue 197 | default['jira']['context_path'] = "/usr/share/tomcat#{node['jira']['container_server']['version']}/conf/Catalina/localhost" 198 | default['jira']['lib_path'] = "/usr/share/tomcat#{node['jira']['container_server']['version']}/lib" 199 | default['jira']['user'] = 'tomcat' 200 | end 201 | else 202 | default['jira']['context'] = '' 203 | default['jira']['context_path'] = "#{node['jira']['install_path']}/conf/Catalina/localhost" 204 | default['jira']['lib_path'] = "#{node['jira']['install_path']}/lib" 205 | default['jira']['user'] = 'jira' 206 | end 207 | end 208 | -------------------------------------------------------------------------------- /chefignore: -------------------------------------------------------------------------------- 1 | # Put files/directories that should be ignored by Chef Server in this file. 2 | # Lines that start with '# ' are comments. 3 | # More info: http://www.opscode.com/blog/2011/04/29/chef-0-10-preview-chefignore/ 4 | 5 | # git 6 | \.gitignore 7 | 8 | # subversion 9 | */.svn/* 10 | 11 | # emacs 12 | *~ 13 | 14 | # vim 15 | *.sw[a-z] 16 | 17 | # tests 18 | \.travis.yml 19 | Rakefile 20 | -------------------------------------------------------------------------------- /files/default/tests/minitest/apache2_test.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../support/helpers', __FILE__) 2 | 3 | describe_recipe 'jira::apache2' do 4 | include Helpers::Jira 5 | 6 | it 'has apache VirtualHost' do 7 | file("#{node['apache']['dir']}/sites-available/#{node['jira']['apache2']['virtual_host_name']}.conf").must_exist 8 | end 9 | 10 | it 'starts apache' do 11 | apache_service.must_be_running 12 | end 13 | 14 | it 'enables apache' do 15 | apache_service.must_be_enabled 16 | end 17 | 18 | end 19 | -------------------------------------------------------------------------------- /files/default/tests/minitest/configuration_test.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../support/helpers', __FILE__) 2 | 3 | describe_recipe 'jira::configuration' do 4 | include Helpers::Jira 5 | 6 | it 'creates Jira database configuration file' do 7 | file("#{node['jira']['home_path']}/dbconfig.xml").must_exist 8 | end 9 | 10 | # it 'creates Jira properties file' do 11 | # file("#{node['jira']['install_path']}/jira-config.properties").must_exist 12 | # end 13 | 14 | end 15 | -------------------------------------------------------------------------------- /files/default/tests/minitest/default_test.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../support/helpers', __FILE__) 2 | 3 | describe_recipe 'jira::default' do 4 | include Helpers::Jira 5 | 6 | end 7 | -------------------------------------------------------------------------------- /files/default/tests/minitest/linux_installer_test.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../support/helpers', __FILE__) 2 | 3 | describe_recipe 'jira::default' do 4 | include Helpers::Jira 5 | 6 | it 'has jira user' do 7 | user(node['jira']['user']).must_exist 8 | end 9 | 10 | it 'creates Java KeyStore' do 11 | file("#{node['jira']['home_path']}/.keystore").must_exist.with(:owner, node['jira']['user']) 12 | end 13 | 14 | it 'starts Jira' do 15 | service('jira').must_be_running 16 | end 17 | 18 | it 'enables Jira' do 19 | service('jira').must_be_enabled 20 | end 21 | 22 | end 23 | -------------------------------------------------------------------------------- /files/default/tests/minitest/support/helpers.rb: -------------------------------------------------------------------------------- 1 | # Helpers module 2 | module Helpers 3 | # Helpers::Jira module 4 | module Jira 5 | include MiniTest::Chef::Assertions 6 | include MiniTest::Chef::Context 7 | include MiniTest::Chef::Resources 8 | 9 | def apache_service 10 | service(case node['platform'] 11 | when 'debian', 'ubuntu' then 'apache2' 12 | when 'freebsd' then 'apache22' 13 | else 'httpd' 14 | end) 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /files/default/tests/minitest/upgrade_test.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../support/helpers', __FILE__) 2 | 3 | describe_recipe 'jira::upgrade' do 4 | include Helpers::Jira 5 | 6 | it 'starts Jira' do 7 | service('jira').must_be_running 8 | end 9 | 10 | it 'enables Jira' do 11 | service('jira').must_be_enabled 12 | end 13 | 14 | end 15 | -------------------------------------------------------------------------------- /libraries/jira.rb: -------------------------------------------------------------------------------- 1 | # Chef class 2 | class Chef 3 | # Chef::Recipe class 4 | class Recipe 5 | # Chef::Recipe::Jira class 6 | class Jira 7 | def self.settings(node) 8 | begin 9 | if Chef::Config[:solo] 10 | begin 11 | settings = Chef::DataBagItem.load('jira', 'jira')['local'] 12 | rescue 13 | Chef::Log.info('No jira data bag found') 14 | end 15 | else 16 | begin 17 | settings = Chef::EncryptedDataBagItem.load('jira', 'jira')[node.chef_environment] 18 | rescue 19 | Chef::Log.info('No jira encrypted data bag found') 20 | end 21 | end 22 | ensure 23 | settings ||= node['jira'] 24 | 25 | case settings['database']['type'] 26 | when 'mysql' 27 | settings['database']['port'] ||= 3306 28 | when 'postgresql' 29 | settings['database']['port'] ||= 5432 30 | else 31 | Chef::Log.warn('Unsupported database type.') 32 | end 33 | end 34 | 35 | settings 36 | end 37 | end 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /metadata.rb: -------------------------------------------------------------------------------- 1 | name 'jira' 2 | maintainer 'Brian Flad' 3 | maintainer_email 'bflad417@gmail.com' 4 | license 'Apache 2.0' 5 | description 'Installs/Configures Atlassian JIRA.' 6 | version '2.0.1' 7 | recipe 'jira', 'Installs/configures Atlassian JIRA' 8 | recipe 'jira::apache2', 'Installs/configures Apache 2 as proxy (ports 80/443)' 9 | recipe 'jira::build_war', 'Builds JIRA WAR' 10 | recipe 'jira::container_server_configuration', 'Configures container server for JIRA deployment' 11 | recipe 'jira::container_server_jars', 'Deploys database/JIRA jars to container server' 12 | recipe 'jira::database', 'Installs/configures MySQL/Postgres server, database, and user for JIRA' 13 | recipe 'jira::installer', 'Installs/configures JIRA via installer' 14 | recipe 'jira::standalone', 'Installs/configures JIRA via standalone archive' 15 | recipe 'jira::sysv', 'Installs/configures JIRA SysV init service' 16 | recipe 'jira::war', 'Installs JIRA WAR' 17 | 18 | depends 'apache2' 19 | depends 'ark' 20 | depends 'database' 21 | depends 'java' 22 | depends 'mysql' 23 | depends 'mysql_connector' 24 | depends 'postgresql' 25 | suggests 'tomcat' 26 | 27 | supports 'centos', '>= 6.0' 28 | supports 'redhat', '>= 6.0' 29 | supports 'ubuntu', '>= 12.04' 30 | -------------------------------------------------------------------------------- /providers/jars.rb: -------------------------------------------------------------------------------- 1 | def load_current_resource 2 | @current_resource = Chef::Resource::JiraJars.new(new_resource) 3 | @current_resource.downloaded(::File.directory?("#{new_resource.download_path}-#{new_resource.version}")) 4 | @current_resource 5 | end 6 | 7 | action :deploy do 8 | download 9 | deploy 10 | new_resource.updated_by_last_action(true) 11 | end 12 | 13 | action :download do 14 | unless downloaded? 15 | download 16 | new_resource.updated_by_last_action(true) 17 | end 18 | end 19 | 20 | def deploy 21 | # Use ruby_block to prevent jar_exists? logic execution during compilation 22 | ruby_block 'deploy_jira_jars' do 23 | block do 24 | new_resource.deploy_jars.each do |jar| 25 | deployable_jar = jar_exists?(jar, new_resource.download_path) 26 | deploy_jar(deployable_jar, new_resource.lib_path) if deployable_jar 27 | end 28 | end 29 | end 30 | end 31 | 32 | def deploy_jar(jar_path, install_path) 33 | jar = ::File.basename(jar_path) 34 | installed_jar = jar_exists?(jar, install_path) 35 | 36 | if installed_jar 37 | if ::File.identical?(jar, installed_jar) 38 | return 39 | else 40 | file installed_jar do 41 | action :delete 42 | end 43 | end 44 | end 45 | link ::File.join(install_path, jar) do 46 | to jar_path 47 | end 48 | new_resource.updated_by_last_action(true) 49 | end 50 | 51 | def download 52 | ark_path = ::File.basename(new_resource.download_path) 53 | prefix_path = ::File.dirname(new_resource.download_path) 54 | 55 | directory prefix_path do 56 | action :create 57 | recursive true 58 | end 59 | 60 | package 'unzip' 61 | 62 | ark ark_path do 63 | prefix_home prefix_path 64 | prefix_root prefix_path 65 | strip_leading_dir false 66 | url new_resource.url 67 | version new_resource.version 68 | end 69 | end 70 | 71 | def downloaded? 72 | @current_resource.downloaded 73 | end 74 | 75 | def jar_exists?(jar, path) 76 | ::Dir.foreach(path) do |file| 77 | next unless file.end_with?('.jar') 78 | return ::File.join(path, file) if file =~ Regexp.new(jar + '-\d+\.\d+(\..*)?\.jar').freeze 79 | end 80 | end 81 | -------------------------------------------------------------------------------- /providers/war.rb: -------------------------------------------------------------------------------- 1 | def load_current_resource 2 | @current_resource = Chef::Resource::JiraWar.new(new_resource) 3 | @current_resource.built(::File.exist?(new_resource.file)) 4 | @current_resource.downloaded(::File.directory?("#{new_resource.path}-#{new_resource.version}")) 5 | @current_resource 6 | end 7 | 8 | action :build do 9 | download 10 | unless built? 11 | build 12 | new_resource.updated_by_last_action(true) 13 | end 14 | end 15 | 16 | action :download do 17 | unless downloaded? 18 | download 19 | new_resource.updated_by_last_action(true) 20 | end 21 | end 22 | 23 | def build 24 | new_resource.exclude_jars.each do |jar| 25 | exclude_jar(jar, ::File.join(new_resource.path, 'webapp', 'WEB-INF', 'lib')) 26 | end 27 | 28 | execute "Building JIRA #{new_resource.version} in #{new_resource.path}" do 29 | cwd new_resource.path 30 | command "./build.sh #{new_resource.targets}" 31 | creates new_resource.file 32 | only_if { node['jira']['build']['enable'] } 33 | end 34 | end 35 | 36 | def built? 37 | @current_resource.built 38 | end 39 | 40 | def download 41 | ark_path = ::File.basename(new_resource.path) 42 | prefix_path = ::File.dirname(new_resource.path) 43 | 44 | directory prefix_path do 45 | action :create 46 | recursive true 47 | end 48 | 49 | ark ark_path do 50 | checksum new_resource.checksum 51 | prefix_home prefix_path 52 | prefix_root prefix_path 53 | url new_resource.url 54 | version new_resource.version 55 | end 56 | end 57 | 58 | def downloaded? 59 | @current_resource.downloaded 60 | end 61 | 62 | def exclude_jar(jar, path) 63 | excluded_jar = jar_exists?(jar, path) 64 | 65 | file excluded_jar do 66 | action :delete 67 | only_if { excluded_jar } 68 | end 69 | end 70 | 71 | def jar_exists?(jar, path) 72 | ::Dir.foreach(path) do |file| 73 | next unless file.end_with?('.jar') 74 | return ::File.join(path, file) if file =~ Regexp.new(jar + '-\d+\.\d+(\..*)?\.jar').freeze 75 | end 76 | end 77 | -------------------------------------------------------------------------------- /recipes/apache2.rb: -------------------------------------------------------------------------------- 1 | node.set['apache']['listen_ports'] = node['apache']['listen_ports'] + [node['jira']['apache2']['port']] unless node['apache']['listen_ports'].include?(node['jira']['apache2']['port']) 2 | node.set['apache']['listen_ports'] = node['apache']['listen_ports'] + [node['jira']['apache2']['ssl']['port']] unless node['apache']['listen_ports'].include?(node['jira']['apache2']['ssl']['port']) 3 | 4 | include_recipe 'apache2' 5 | include_recipe 'apache2::mod_proxy' 6 | include_recipe 'apache2::mod_proxy_http' 7 | include_recipe 'apache2::mod_ssl' 8 | 9 | web_app node['jira']['apache2']['virtual_host_name'] 10 | -------------------------------------------------------------------------------- /recipes/build_war.rb: -------------------------------------------------------------------------------- 1 | jira_war node['jira']['install_path'] do 2 | action :build 3 | end 4 | -------------------------------------------------------------------------------- /recipes/configuration.rb: -------------------------------------------------------------------------------- 1 | settings = Jira.settings(node) 2 | 3 | directory node['jira']['home_path'] do 4 | owner node['jira']['user'] 5 | action :create 6 | recursive true 7 | end 8 | 9 | template "#{node['jira']['home_path']}/dbconfig.xml" do 10 | source 'dbconfig.xml.erb' 11 | owner node['jira']['user'] 12 | mode '0644' 13 | variables :database => settings['database'] 14 | notifies :restart, 'service[jira]', :delayed unless node['jira']['install_type'] == 'war' 15 | end 16 | 17 | template "#{node['jira']['install_path']}/edit-webapp/WEB-INF/classes/jira-application.properties" do 18 | source 'jira-application.properties.erb' 19 | mode '0644' 20 | only_if { node['jira']['install_type'] == 'war' } 21 | end 22 | -------------------------------------------------------------------------------- /recipes/container_server_configuration.rb: -------------------------------------------------------------------------------- 1 | settings = Jira.settings(node) 2 | 3 | case node['jira']['container_server']['name'] 4 | when 'tomcat' 5 | if node['jira']['install_type'] == 'war' 6 | # Only should configure context pointing to war file 7 | 8 | template "#{node['jira']['context_path']}/#{node['jira']['context']}.xml" do 9 | source 'tomcat/context.xml.erb' 10 | notifies :restart, 'service[tomcat]', :delayed 11 | only_if "test -f #{node['jira']['war']['file']}" 12 | end 13 | else 14 | # Installer and standalone installs bundle a Tomcat instance 15 | # This section customizes said Tomcat instance 16 | 17 | template "#{node['jira']['install_path']}/bin/permgen.sh" do 18 | source 'tomcat/permgen.sh.erb' 19 | owner node['jira']['user'] 20 | mode '0755' 21 | notifies :restart, 'service[jira]', :delayed 22 | end 23 | 24 | template "#{node['jira']['install_path']}/bin/setenv.sh" do 25 | source 'tomcat/setenv.sh.erb' 26 | owner node['jira']['user'] 27 | mode '0755' 28 | notifies :restart, 'service[jira]', :delayed 29 | end 30 | 31 | template "#{node['jira']['install_path']}/conf/server.xml" do 32 | source 'tomcat/server.xml.erb' 33 | owner node['jira']['user'] 34 | mode '0640' 35 | variables :tomcat => settings['tomcat'] 36 | notifies :restart, 'service[jira]', :delayed 37 | end 38 | 39 | template "#{node['jira']['install_path']}/conf/web.xml" do 40 | source 'tomcat/web.xml.erb' 41 | owner node['jira']['user'] 42 | mode '0644' 43 | notifies :restart, 'service[jira]', :delayed 44 | end 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /recipes/container_server_jars.rb: -------------------------------------------------------------------------------- 1 | settings = Jira.settings(node) 2 | 3 | directory node['jira']['lib_path'] do 4 | action :create 5 | end 6 | 7 | mysql_connector_j node['jira']['lib_path'] if settings['database']['type'] == 'mysql' 8 | 9 | jira_jars node['jira']['jars']['install_path'] do 10 | action :deploy 11 | only_if { node['jira']['install_type'] == 'war' && node['jira']['container_server']['name'] == 'tomcat' } 12 | end 13 | -------------------------------------------------------------------------------- /recipes/database.rb: -------------------------------------------------------------------------------- 1 | settings = Jira.settings(node) 2 | 3 | database_connection = { 4 | :host => settings['database']['host'], 5 | :port => settings['database']['port'] 6 | } 7 | 8 | case settings['database']['type'] 9 | when 'mysql' 10 | include_recipe 'mysql::server' 11 | include_recipe 'database::mysql' 12 | database_connection.merge!(:username => 'root', :password => node['mysql']['server_root_password']) 13 | 14 | mysql_database settings['database']['name'] do 15 | connection database_connection 16 | collation 'utf8_bin' 17 | encoding 'utf8' 18 | action :create 19 | end 20 | 21 | # See this MySQL bug: http://bugs.mysql.com/bug.php?id=31061 22 | mysql_database_user '' do 23 | connection database_connection 24 | host 'localhost' 25 | action :drop 26 | end 27 | 28 | mysql_database_user settings['database']['user'] do 29 | connection database_connection 30 | host '%' 31 | password settings['database']['password'] 32 | database_name settings['database']['name'] 33 | action [:create, :grant] 34 | end 35 | when 'postgresql' 36 | include_recipe 'postgresql::server' 37 | include_recipe 'database::postgresql' 38 | database_connection.merge!(:username => 'postgres', :password => node['postgresql']['password']['postgres']) 39 | 40 | postgresql_database settings['database']['name'] do 41 | connection database_connection 42 | connection_limit '-1' 43 | encoding 'utf8' 44 | action :create 45 | end 46 | 47 | postgresql_database_user settings['database']['user'] do 48 | connection database_connection 49 | password settings['database']['password'] 50 | database_name settings['database']['name'] 51 | action [:create, :grant] 52 | end 53 | end 54 | -------------------------------------------------------------------------------- /recipes/default.rb: -------------------------------------------------------------------------------- 1 | settings = Jira.settings(node) 2 | 3 | include_recipe 'jira::database' if settings['database']['host'] == 'localhost' 4 | include_recipe "jira::#{node['jira']['install_type']}" 5 | include_recipe 'jira::configuration' 6 | include_recipe 'jira::build_war' if node['jira']['install_type'] == 'war' 7 | include_recipe 'jira::container_server_jars' 8 | include_recipe 'jira::container_server_configuration' 9 | unless node['jira']['install_type'] == 'war' 10 | include_recipe "jira::#{node['jira']['init_type']}" 11 | include_recipe 'jira::apache2' 12 | end 13 | -------------------------------------------------------------------------------- /recipes/installer.rb: -------------------------------------------------------------------------------- 1 | template "#{Chef::Config[:file_cache_path]}/atlassian-jira-response.varfile" do 2 | source 'response.varfile.erb' 3 | owner 'root' 4 | group 'root' 5 | mode '0644' 6 | end 7 | 8 | remote_file "#{Chef::Config[:file_cache_path]}/atlassian-jira-#{node['jira']['version']}-#{node['jira']['arch']}.bin" do 9 | source node['jira']['url'] 10 | checksum node['jira']['checksum'] 11 | mode '0755' 12 | action :create 13 | end 14 | 15 | execute "Installing Jira #{node['jira']['version']}" do 16 | cwd Chef::Config[:file_cache_path] 17 | command "./atlassian-jira-#{node['jira']['version']}-#{node['jira']['arch']}.bin -q -varfile atlassian-jira-response.varfile" 18 | creates node['jira']['install_path'] 19 | end 20 | 21 | execute 'Generating Self-Signed Java Keystore' do 22 | command <<-COMMAND 23 | #{node['java']['java_home']}/bin/keytool -genkey \ 24 | -alias tomcat \ 25 | -keyalg RSA \ 26 | -dname 'CN=#{node['fqdn']}, OU=Example, O=Example, L=Example, ST=Example, C=US' \ 27 | -keypass changeit \ 28 | -storepass changeit \ 29 | -keystore #{node['jira']['home_path']}/.keystore 30 | chown #{node['jira']['user']}:#{node['jira']['user']} #{node['jira']['home_path']}/.keystore 31 | COMMAND 32 | creates "#{node['jira']['home_path']}/.keystore" 33 | end 34 | -------------------------------------------------------------------------------- /recipes/standalone.rb: -------------------------------------------------------------------------------- 1 | ark_prefix_path = ::File.dirname(node['jira']['install_path']) if ::File.basename(node['jira']['install_path']) == 'jira' 2 | ark_prefix_path ||= node['jira']['install_path'] 3 | settings = Jira.settings(node) 4 | 5 | directory File.dirname(node['jira']['home_path']) do 6 | owner 'root' 7 | group 'root' 8 | mode 00755 9 | action :create 10 | recursive true 11 | end 12 | 13 | user node['jira']['user'] do 14 | comment 'JIRA Service Account' 15 | home node['jira']['home_path'] 16 | shell '/bin/bash' 17 | supports :manage_home => true 18 | system true 19 | action :create 20 | end 21 | 22 | execute 'Generating Self-Signed Java Keystore' do 23 | command <<-COMMAND 24 | #{node['java']['java_home']}/bin/keytool -genkey \ 25 | -alias #{settings['tomcat']['keyAlias']} \ 26 | -keyalg RSA \ 27 | -dname 'CN=#{node['fqdn']}, OU=Example, O=Example, L=Example, ST=Example, C=US' \ 28 | -keypass #{settings['tomcat']['keystorePass']} \ 29 | -storepass #{settings['tomcat']['keystorePass']} \ 30 | -keystore #{settings['tomcat']['keystoreFile']} 31 | chown #{node['jira']['user']}:#{node['jira']['user']} #{settings['tomcat']['keystoreFile']} 32 | COMMAND 33 | creates settings['tomcat']['keystoreFile'] 34 | only_if { settings['tomcat']['keystoreFile'] == "#{node['jira']['home_path']}/.keystore" } 35 | end 36 | 37 | directory ark_prefix_path do 38 | action :create 39 | recursive true 40 | end 41 | 42 | ark 'jira' do 43 | url node['jira']['url'] 44 | prefix_root ark_prefix_path 45 | prefix_home ark_prefix_path 46 | checksum node['jira']['checksum'] 47 | version node['jira']['version'] 48 | owner node['jira']['user'] 49 | group node['jira']['user'] 50 | end 51 | -------------------------------------------------------------------------------- /recipes/sysv.rb: -------------------------------------------------------------------------------- 1 | template '/etc/init.d/jira' do 2 | source 'jira.init.erb' 3 | mode '0755' 4 | notifies :restart, 'service[jira]', :delayed 5 | end 6 | 7 | service 'jira' do 8 | supports :status => :true, :restart => :true 9 | action :enable 10 | subscribes :restart, 'java_ark[jdk]' 11 | end 12 | -------------------------------------------------------------------------------- /recipes/war.rb: -------------------------------------------------------------------------------- 1 | jira_war node['jira']['install_path'] 2 | -------------------------------------------------------------------------------- /resources/jars.rb: -------------------------------------------------------------------------------- 1 | actions :deploy, :download 2 | 3 | default_action :download 4 | 5 | attribute :download_path, :name_attribute => true 6 | 7 | attribute :deploy_jars, :kind_of => [Array], :default => node['jira']['jars']['deploy_jars'] 8 | attribute :lib_path, :kind_of => [String], :default => node['jira']['lib_path'] 9 | attribute :url, :kind_of => [String], :default => node['jira']['jars']['url'] 10 | attribute :version, :kind_of => [String], :default => node['jira']['jars']['version'] 11 | 12 | # Internal attributes 13 | attribute :downloaded, :kind_of => [TrueClass, FalseClass], :default => false 14 | -------------------------------------------------------------------------------- /resources/war.rb: -------------------------------------------------------------------------------- 1 | actions :build, :download 2 | 3 | default_action :download 4 | 5 | attribute :path, :name_attribute => true 6 | 7 | attribute :checksum, :kind_of => [String], :default => node['jira']['checksum'] 8 | attribute :exclude_jars, :kind_of => [Array], :default => node['jira']['build']['exclude_jars'] 9 | attribute :file, :kind_of => [String], :default => node['jira']['build']['file'] 10 | attribute :targets, :kind_of => [String], :default => node['jira']['build']['targets'] 11 | attribute :url, :kind_of => [String], :default => node['jira']['url'] 12 | attribute :version, :kind_of => [String], :default => node['jira']['version'] 13 | 14 | # Internal attributes 15 | attribute :built, :kind_of => [TrueClass, FalseClass], :default => false 16 | attribute :downloaded, :kind_of => [TrueClass, FalseClass], :default => false 17 | -------------------------------------------------------------------------------- /spec/apache2_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'jira::apache2' do 4 | let(:chef_run) do 5 | ChefSpec::Runner.new.converge(described_recipe) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /spec/build_war_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'jira::build_war' do 4 | let(:chef_run) do 5 | ChefSpec::Runner.new.converge(described_recipe) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /spec/configuration_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'jira::configuration' do 4 | let(:chef_run) do 5 | ChefSpec::Runner.new.converge(described_recipe) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /spec/container_server_configuration_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'jira::container_server_configuration' do 4 | let(:chef_run) do 5 | ChefSpec::Runner.new.converge(described_recipe) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /spec/container_server_jars_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'jira::container_server_jars' do 4 | let(:chef_run) do 5 | ChefSpec::Runner.new.converge(described_recipe) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /spec/database_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'jira::database' do 4 | let(:chef_run) do 5 | ChefSpec::Runner.new.converge(described_recipe) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /spec/default_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'jira::default' do 4 | let(:chef_run) do 5 | ChefSpec::Runner.new.converge(described_recipe) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /spec/installer_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'jira::installer' do 4 | let(:chef_run) do 5 | ChefSpec::Runner.new.converge(described_recipe) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'chefspec' 2 | require 'chefspec/berkshelf' 3 | 4 | # See https://github.com/sethvargo/chefspec/issues/393 5 | # ChefSpec::Coverage.start! 6 | 7 | RSpec.configure do |config| 8 | config.log_level = :error 9 | config.platform = 'ubuntu' 10 | config.version = '12.04' 11 | end 12 | -------------------------------------------------------------------------------- /spec/standalone_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'jira::standalone' do 4 | let(:chef_run) do 5 | ChefSpec::Runner.new.converge(described_recipe) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /spec/sysv_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'jira::sysv' do 4 | let(:chef_run) do 5 | ChefSpec::Runner.new.converge(described_recipe) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /spec/war_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'jira::war' do 4 | let(:chef_run) do 5 | ChefSpec::Runner.new.converge(described_recipe) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /templates/default/dbconfig.xml.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | defaultDS 5 | default 6 | <% case @database["type"] -%> 7 | <% when "mysql" -%> 8 | mysql 9 | <% when "postgresql" -%> 10 | postgres 11 | public 12 | <% when "mssql" -%> 13 | mssql 14 | dbo 15 | <% end -%> 16 | 17 | <% case @database["type"] -%> 18 | <% when "mysql" -%> 19 | jdbc:mysql://<%= @database["host"] %>:<%= @database["port"] %>/<%= @database["name"] %>?useUnicode=true&characterEncoding=UTF8&sessionVariables=storage_engine=InnoDB 20 | com.mysql.jdbc.Driver 21 | 60000 22 | true 23 | 300000 24 | select 1 25 | 3 26 | <% when "postgresql" -%> 27 | jdbc:postgresql://<%= @database["host"] %>:<%= @database["port"] %>/<%= @database["name"] %> 28 | org.postgresql.Driver 29 | <% when "mssql" -%> 30 | jdbc:jtds:sqlserver://<%= @database["host"] %>:<%= @database["port"] %>/<%= @database["name"] %> 31 | net.sourceforge.jtds.jdbc.Driver 32 | select 1 33 | 60000 34 | 300000 35 | true 36 | <% end -%> 37 | <%= @database["user"] %> 38 | <%= @database["password"] %> 39 | 20 40 | 20 41 | 20 42 | 30000 43 | true 44 | 300 45 | 46 | 47 | -------------------------------------------------------------------------------- /templates/default/jira-application.properties.erb: -------------------------------------------------------------------------------- 1 | # 2 | # Dynamically generated by Chef on <%= node["fqdn"] %> 3 | # Local modifications will be overwritten by Chef. 4 | # 5 | 6 | jira.home = <%= node['jira']['home_path'] %> 7 | -------------------------------------------------------------------------------- /templates/default/jira.init.erb: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # JIRA startup script 3 | # Adapted from: http://confluence.atlassian.com/display/JIRA/Starting+JIRA+Automatically+on+Linux 4 | # Dynamically generated by Chef on <%= node["fqdn"] %> 5 | # Local modifications will be overwritten by Chef. 6 | #chkconfig: 2345 80 05 7 | #description: Atlassian JIRA 8 | 9 | ### BEGIN INIT INFO 10 | # Provides: jira 11 | # Required-Start: $local_fs $remote_fs $network $syslog $named 12 | # Required-Stop: $local_fs $remote_fs $network $syslog $named 13 | # Default-Start: 2 3 4 5 14 | # Default-Stop: 0 1 6 15 | # X-Interactive: true 16 | # Short-Description: Start/stop Atlassian JIRA standalone server 17 | ### END INIT INFO 18 | 19 | # Source function library. 20 | . /etc/rc.d/init.d/functions 21 | 22 | # JIRA Linux service controller script 23 | APP=JIRA 24 | BASE=<%= node['jira']['install_path'] %> 25 | cd $BASE/bin 26 | 27 | function start { 28 | echo "Starting $APP" 29 | ./start-jira.sh 30 | return $? 31 | } 32 | 33 | function stop { 34 | echo "Stopping $APP" 35 | ./stop-jira.sh 36 | return $? 37 | } 38 | 39 | case "$1" in 40 | start) 41 | start 42 | RETVAL=$? 43 | ;; 44 | stop) 45 | stop 46 | RETVAL=$? 47 | ;; 48 | restart) 49 | stop 50 | start 51 | RETVAL=$? 52 | ;; 53 | status) 54 | status -p $BASE/work/catalina.pid $APP 55 | RETVAL=$? 56 | ;; 57 | *) 58 | echo "Usage: $0 {start|restart|stop|status}" 59 | RETVAL=2 60 | ;; 61 | esac 62 | 63 | exit $RETVAL 64 | -------------------------------------------------------------------------------- /templates/default/response.varfile.erb: -------------------------------------------------------------------------------- 1 | # 2 | # Dynamically generated by Chef on <%= node["fqdn"] %> 3 | # Local modifications will be overwritten by Chef. 4 | # 5 | rmiPort$Long=8005 6 | app.jiraHome=<%= node['jira']['home_path'] %> 7 | app.install.service$Boolean=true 8 | existingInstallationDir=<%= node['jira']['install_path'] %> 9 | sys.confirmedUpdateInstallationString=<%= node['jira']['update'] ? "true" : "false" %> 10 | sys.languageId=en 11 | sys.installationDir=<%= node['jira']['install_path'] %> 12 | executeLauncherAction$Boolean=true 13 | httpPort$Long=<%= node['jira']['tomcat']['port'] %> 14 | portChoice=default 15 | -------------------------------------------------------------------------------- /templates/default/tomcat/context.xml.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /templates/default/tomcat/permgen.sh.erb: -------------------------------------------------------------------------------- 1 | # 2 | # Dynamically generated by Chef on <%= node["fqdn"] %> 3 | # Local modifications will be overwritten by Chef. 4 | # 5 | 6 | # 7 | # This will try to detect whether the PermGen command line arguments can be used. 8 | # On an IBM JVM, the default permgen arguments are not valid 9 | # 10 | 11 | # DO NOT remove the following line 12 | <% if node['java'] && node['java']['java_home'] -%> 13 | JAVA_HOME="<%= node['java']['java_home'] %>/jre/"; export JAVA_HOME 14 | <% else -%> 15 | JAVA_HOME="<%= node['jira']['install_path'] %>/jre/"; export JAVA_HOME 16 | <% end -%> 17 | 18 | # let Tomcat's setclasspath.sh figure out the java location for us 19 | if $os400; then 20 | # -r will Only work on the os400 if the files are: 21 | # 1. owned by the user 22 | # 2. owned by the PRIMARY group of the user 23 | # this will not work if the user belongs in secondary groups 24 | MY_JRE_HOME=`( BASEDIR="$CATALINA_HOME"; . "$CATALINA_HOME"/bin/setclasspath.sh; echo $JRE_HOME )` 25 | MY_JAVA_HOME=`( BASEDIR="$CATALINA_HOME"; . "$CATALINA_HOME"/bin/setclasspath.sh; echo $JAVA_HOME )` 26 | else 27 | if [ -r "$CATALINA_HOME"/bin/setclasspath.sh ]; then 28 | MY_JRE_HOME=`( BASEDIR="$CATALINA_HOME"; . "$CATALINA_HOME"/bin/setclasspath.sh; echo $JRE_HOME )` 29 | MY_JAVA_HOME=`( BASEDIR="$CATALINA_HOME"; . "$CATALINA_HOME"/bin/setclasspath.sh; echo $JAVA_HOME )` 30 | else 31 | echo "Cannot find $CATALINA_HOME/bin/setclasspath.sh" 32 | echo "This file is needed to run this program" 33 | exit 1 34 | fi 35 | fi 36 | 37 | # 38 | # Catalina looks in 2 places - JAVA_HOME and JRE_HOME 39 | # 40 | JAVA_PERMGEN_SUPPORTED=true 41 | JAVA_LOCATION=${MY_JAVA_HOME} 42 | if [ -z "$MY_JAVA_HOME" ]; then 43 | JAVA_LOCATION=${MY_JRE_HOME} 44 | fi 45 | 46 | # 47 | # Determine which JVM is being used 48 | # 49 | if [ -n "${JAVA_LOCATION}" ]; then 50 | if [ -x "${JAVA_LOCATION}"/bin/java ]; then 51 | "${JAVA_LOCATION}"/bin/java -version 2>&1 | grep IBM 52 | RT_CODE=$? 53 | if [ ${RT_CODE} -eq 0 ]; then 54 | JAVA_PERMGEN_SUPPORTED=false 55 | fi 56 | fi 57 | fi 58 | export JAVA_PERMGEN_SUPPORTED 59 | -------------------------------------------------------------------------------- /templates/default/tomcat/server.xml.erb: -------------------------------------------------------------------------------- 1 | 2 | 14 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 41 | 42 | 47 | 48 | 49 | 60 | redirectPort="<%= node['jira']['apache2']['ssl']['port'] %>" 61 | secure="true" 62 | scheme="https" 63 | proxyName="<%= node['jira']['apache2']['virtual_host_alias'] %>" 64 | proxyPort="<%= node['jira']['apache2']['ssl']['port'] %>" 65 | <% else -%> 66 | redirectPort="<%= node['jira']['tomcat']['ssl_port'] %>" 67 | <% end -%> 68 | acceptCount="100" 69 | disableUploadTimeout="true"/> 70 | 71 | 95 | 96 | 111 | <%= "keyAlias=\"#{@tomcat['keyAlias']}\"" if @tomcat['keyAlias'] %> 112 | <%= "keystoreFile=\"#{@tomcat['keystoreFile']}\"" if @tomcat['keystoreFile'] %> 113 | <%= "keystorePass=\"#{@tomcat['keystorePass']}\"" if @tomcat['keystorePass'] %> 114 | <% end -%> 115 | /> 116 | 117 | 118 | 119 | 130 | 131 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 149 | 150 | 152 | 153 | 154 | 155 | 156 | 157 | 185 | 187 | 188 | 189 | 190 | -------------------------------------------------------------------------------- /templates/default/tomcat/setenv.sh.erb: -------------------------------------------------------------------------------- 1 | # 2 | # Dynamically generated by Chef on <%= node["fqdn"] %> 3 | # Local modifications will be overwritten by Chef. 4 | # 5 | 6 | # 7 | # One way to set the JIRA HOME path is here via this variable. Simply uncomment it and set a valid path like /jira/home. You can of course set it outside in the command terminal. That will also work. 8 | # 9 | JIRA_HOME="<%= node['jira']['home_path'] %>" 10 | 11 | # 12 | # Occasionally Atlassian Support may recommend that you set some specific JVM arguments. You can use this variable below to do that. 13 | # 14 | JVM_SUPPORT_RECOMMENDED_ARGS="<%= node['jira']['jvm']['support_args'] %>" 15 | 16 | # 17 | # The following 2 settings control the minimum and maximum given to the JIRA Java virtual machine. In larger JIRA instances, the maximum amount will need to be increased. 18 | # 19 | JVM_MINIMUM_MEMORY="<%= node['jira']['jvm']['minimum_memory'] %>" 20 | JVM_MAXIMUM_MEMORY="<%= node['jira']['jvm']['maximum_memory'] %>" 21 | 22 | # 23 | # The following are the required arguments for JIRA. 24 | # 25 | JVM_REQUIRED_ARGS="-Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true" 26 | 27 | # 28 | # Additional JVM arguments 29 | # 30 | JAVA_OPTS="<%= node['jira']['jvm']['java_opts'] %> ${JAVA_OPTS}" 31 | 32 | # Uncomment this setting if you want to import data without notifications 33 | # 34 | #DISABLE_NOTIFICATIONS=" -Datlassian.mail.senddisabled=true -Datlassian.mail.fetchdisabled=true -Datlassian.mail.popdisabled=true" 35 | 36 | 37 | #----------------------------------------------------------------------------------- 38 | # 39 | # In general don't make changes below here 40 | # 41 | #----------------------------------------------------------------------------------- 42 | 43 | #----------------------------------------------------------------------------------- 44 | # This allows us to actually debug GC related issues by correlating timestamps 45 | # with other parts of the application logs. 46 | #----------------------------------------------------------------------------------- 47 | JVM_EXTRA_ARGS="-XX:+PrintGCDateStamps" 48 | 49 | PRGDIR=`dirname "$0"` 50 | cat "${PRGDIR}"/jirabanner.txt 51 | 52 | JIRA_HOME_MINUSD="" 53 | if [ "$JIRA_HOME" != "" ]; then 54 | echo $JIRA_HOME | grep -q " " 55 | if [ $? -eq 0 ]; then 56 | echo "" 57 | echo "--------------------------------------------------------------------------------------------------------------------" 58 | echo " WARNING : You cannot have a JIRA_HOME environment variable set with spaces in it. This variable is being ignored" 59 | echo "--------------------------------------------------------------------------------------------------------------------" 60 | else 61 | JIRA_HOME_MINUSD=-Djira.home=$JIRA_HOME 62 | fi 63 | fi 64 | 65 | JAVA_OPTS="-Xms${JVM_MINIMUM_MEMORY} -Xmx${JVM_MAXIMUM_MEMORY} ${JAVA_OPTS} ${JVM_REQUIRED_ARGS} ${DISABLE_NOTIFICATIONS} ${JVM_SUPPORT_RECOMMENDED_ARGS} ${JVM_EXTRA_ARGS} ${JIRA_HOME_MINUSD}" 66 | 67 | # Perm Gen size needs to be increased if encountering OutOfMemoryError: PermGen problems. Specifying PermGen size is not valid on IBM JDKs 68 | JIRA_MAX_PERM_SIZE="<%= node['jira']['jvm']['maximum_permgen'] %>" 69 | if [ -f "${PRGDIR}/permgen.sh" ]; then 70 | echo "Detecting JVM PermGen support..." 71 | . "${PRGDIR}/permgen.sh" 72 | if [ $JAVA_PERMGEN_SUPPORTED = "true" ]; then 73 | echo "PermGen switch is supported. Setting to ${JIRA_MAX_PERM_SIZE}" 74 | JAVA_OPTS="-XX:MaxPermSize=${JIRA_MAX_PERM_SIZE} ${JAVA_OPTS}" 75 | else 76 | echo "PermGen switch is NOT supported and will NOT be set automatically." 77 | fi 78 | fi 79 | 80 | export JAVA_OPTS 81 | 82 | echo "" 83 | echo "If you encounter issues starting or stopping JIRA, please see the Troubleshooting guide at http://confluence.atlassian.com/display/JIRA/Installation+Troubleshooting+Guide" 84 | echo "" 85 | if [ "$JIRA_HOME_MINUSD" != "" ]; then 86 | echo "Using JIRA_HOME: $JIRA_HOME" 87 | fi 88 | 89 | # set the location of the pid file 90 | if [ -z "$CATALINA_PID" ] ; then 91 | if [ -n "$CATALINA_BASE" ] ; then 92 | CATALINA_PID="$CATALINA_BASE"/work/catalina.pid 93 | elif [ -n "$CATALINA_HOME" ] ; then 94 | CATALINA_PID="$CATALINA_HOME"/work/catalina.pid 95 | fi 96 | fi 97 | export CATALINA_PID 98 | 99 | if [ -z "$CATALINA_BASE" ]; then 100 | if [ -z "$CATALINA_HOME" ]; then 101 | LOGBASE=$PRGDIR 102 | LOGTAIL=.. 103 | else 104 | LOGBASE=$CATALINA_HOME 105 | LOGTAIL=. 106 | fi 107 | else 108 | LOGBASE=$CATALINA_BASE 109 | LOGTAIL=. 110 | fi 111 | 112 | PUSHED_DIR=`pwd` 113 | cd $LOGBASE 114 | cd $LOGTAIL 115 | LOGBASEABS=`pwd` 116 | cd $PUSHED_DIR 117 | 118 | echo "" 119 | echo "Server startup logs are located in $LOGBASEABS/logs/catalina.out" 120 | -------------------------------------------------------------------------------- /templates/default/web_app.conf.erb: -------------------------------------------------------------------------------- 1 | # 2 | # Dynamically generated by Chef on <%= node["fqdn"] %> 3 | # Local modifications will be overwritten by Chef. 4 | # 5 | > 6 | <% unless node['jira']['apache2']['virtual_host_name'].empty? -%> 7 | ServerName <%= node['jira']['apache2']['virtual_host_name'] %> 8 | <% end -%> 9 | <% unless node['jira']['apache2']['virtual_host_alias'].empty? -%> 10 | <% virtual_host_aliases = node['jira']['apache2']['virtual_host_alias'].kind_of?(Array) ? node['jira']['apache2']['virtual_host_alias'] : [ node['jira']['apache2']['virtual_host_alias'] ] -%> 11 | <% virtual_host_aliases.each do |virtual_host_alias| -%> 12 | ServerAlias <%= virtual_host_alias %> 13 | <% end -%> 14 | <% end -%> 15 | DocumentRoot <%= node['jira']['install_path'] %> 16 | 17 | CustomLog <%= node['jira']['apache2']['access_log'].empty? ? node['apache']['log_dir']+"/jira-access.log" : node['jira']['apache2']['access_log'] %> combined 18 | ErrorLog <%= node['jira']['apache2']['error_log'].empty? ? node['apache']['log_dir']+"/jira-error.log" : node['jira']['apache2']['error_log'] %> 19 | LogLevel warn 20 | 21 | 22 | Order Deny,Allow 23 | Allow from all 24 | 25 | ProxyPass / http://localhost:<%= node['jira']['tomcat']['port'] %>/ connectiontimeout=5 timeout=300 26 | ProxyPassReverse / http://localhost:<%= node['jira']['tomcat']['port'] %>/ 27 | 28 | 29 | > 30 | <% unless node['jira']['apache2']['virtual_host_name'].empty? -%> 31 | ServerName <%= node['jira']['apache2']['virtual_host_name'] %> 32 | <% end -%> 33 | <% unless node['jira']['apache2']['virtual_host_alias'].empty? -%> 34 | <% virtual_host_aliases = node['jira']['apache2']['virtual_host_alias'].kind_of?(Array) ? node['jira']['apache2']['virtual_host_alias'] : [ node['jira']['apache2']['virtual_host_alias'] ] -%> 35 | <% virtual_host_aliases.each do |virtual_host_alias| -%> 36 | ServerAlias <%= virtual_host_alias %> 37 | <% end -%> 38 | <% end -%> 39 | DocumentRoot <%= node['jira']['install_path'] %> 40 | 41 | CustomLog <%= node['jira']['apache2']['ssl']['access_log'].empty? ? node['apache']['log_dir']+"/jira-ssl-access.log" : node['jira']['apache2']['ssl']['access_log'] %> combined 42 | ErrorLog <%= node['jira']['apache2']['ssl']['error_log'].empty? ? node['apache']['log_dir']+"/jira-ssl-error.log" : node['jira']['apache2']['ssl']['error_log'] %> 43 | LogLevel warn 44 | 45 | 46 | Order Deny,Allow 47 | Allow from all 48 | 49 | ProxyPass / http://localhost:<%= node['jira']['tomcat']['port'] %>/ connectiontimeout=5 timeout=300 50 | ProxyPassReverse / http://localhost:<%= node['jira']['tomcat']['port'] %>/ 51 | 52 | SSLEngine on 53 | SSLCertificateFile <%= node['jira']['apache2']['ssl']['certificate_file'] %> 54 | SSLCertificateKeyFile <%= node['jira']['apache2']['ssl']['key_file'] %> 55 | <% unless node['jira']['apache2']['ssl']['chain_file'].empty? -%> 56 | SSLCertificateChainFile <%= node['jira']['apache2']['ssl']['chain_file'] %> 57 | <% end -%> 58 | 59 | -------------------------------------------------------------------------------- /test/.chef/knife.rb: -------------------------------------------------------------------------------- 1 | cache_type 'BasicFile' 2 | cache_options(:path => "#{ENV['HOME']}/.chef/checksums") 3 | -------------------------------------------------------------------------------- /test/cookbooks/jira_test/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CHANGELOG for jira_test 2 | 3 | This file is used to list changes made in each version of jira_test. 4 | 5 | ## 0.1.0: 6 | 7 | * Initial release of jira_test 8 | 9 | - - - 10 | Check the [Markdown Syntax Guide](http://daringfireball.net/projects/markdown/syntax) for help with Markdown. 11 | 12 | The [Github Flavored Markdown page](http://github.github.com/github-flavored-markdown/) describes the differences between markdown on github and standard markdown. 13 | -------------------------------------------------------------------------------- /test/cookbooks/jira_test/README.md: -------------------------------------------------------------------------------- 1 | jira_test Cookbook 2 | =================== 3 | 4 | This cookbook defines acceptance tests for JIRA. 5 | 6 | Requirements 7 | ------------ 8 | 9 | ## Cookbooks: 10 | 11 | * java 12 | 13 | ## Platforms: 14 | 15 | * CentOS 6 16 | * Ubuntu 12.04 17 | 18 | Attributes 19 | ---------- 20 | 21 | See attributes set by this cookbook in attributes/default.rb 22 | 23 | Recipes 24 | ------- 25 | 26 | * `default` - includes `jira::default` 27 | 28 | Contributing 29 | ------------ 30 | TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section. 31 | 32 | e.g. 33 | 1. Fork the repository on Github 34 | 2. Create a named feature branch (like `add_component_x`) 35 | 3. Write you change 36 | 4. Write tests for your change (if applicable) 37 | 5. Run the tests, ensuring they all pass 38 | 6. Submit a Pull Request using Github 39 | 40 | License and Authors 41 | ------------------- 42 | 43 | Author:: Brian Flad 44 | 45 | Copyright:: 2013 46 | 47 | Licensed under the Apache License, Version 2.0 (the "License"); 48 | you may not use this file except in compliance with the License. 49 | You may obtain a copy of the License at 50 | 51 | http://www.apache.org/licenses/LICENSE-2.0 52 | 53 | Unless required by applicable law or agreed to in writing, software 54 | distributed under the License is distributed on an "AS IS" BASIS, 55 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 56 | See the License for the specific language governing permissions and 57 | limitations under the License. 58 | -------------------------------------------------------------------------------- /test/cookbooks/jira_test/attributes/default.rb: -------------------------------------------------------------------------------- 1 | 2 | set["java"]["install_flavor"] = "oracle" 3 | #set["java"]["java_home"] = "/usr/lib/jvm/java-7-oracle" 4 | #set["java"]["jdk_version"] = "7" 5 | set["java"]["oracle"]["accept_oracle_download_terms"] = true 6 | 7 | set["mysql"]["bind_address"] = "0.0.0.0" 8 | set["mysql"]["server_root_password"] = "iloverandompasswords" 9 | set["mysql"]["server_repl_password"] = "iloverandompasswords" 10 | set["mysql"]["server_debian_password"] = "iloverandompasswords" 11 | -------------------------------------------------------------------------------- /test/cookbooks/jira_test/metadata.rb: -------------------------------------------------------------------------------- 1 | name 'jira_test' 2 | maintainer 'Brian Flad' 3 | maintainer_email 'bflad417@gmail.com' 4 | license 'Apache 2.0' 5 | description 'Installs/Configures jira_test' 6 | long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) 7 | version '0.1.0' 8 | 9 | depends "java" 10 | depends "jira" 11 | -------------------------------------------------------------------------------- /test/cookbooks/jira_test/recipes/default.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: jira_test 3 | # Recipe:: default 4 | # 5 | # Copyright 2013, Brian Flad 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | include_recipe "java" 21 | include_recipe "jira" 22 | -------------------------------------------------------------------------------- /test/support/Gemfile.ci: -------------------------------------------------------------------------------- 1 | source :rubygems 2 | 3 | gem 'chef', '~> 10.24.0' 4 | gem "foodcritic" 5 | gem "rake" 6 | --------------------------------------------------------------------------------