From 481bb00748fd185399cc85e912a9baf805e44d06 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Thu, 9 Jul 2015 17:36:20 -0400 Subject: [PATCH 01/26] Added DigitalOcean testing for patcon/chef-stash repo. --- .travis.yml | 44 +++++++++++++++++++++++++---- Gemfile | 1 + test/support/travis_id_rsa.key.enc | Bin 0 -> 1680 bytes 3 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 test/support/travis_id_rsa.key.enc diff --git a/.travis.yml b/.travis.yml index 7044d71..ae72f54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,44 @@ language: ruby -bundler_args: --without integration + cache: bundler -sudo: false + rvm: - - 2.0.0 +- 2.0.0 + +env: + global: + # Uses public key of private keypair set up in `before_install` task. + - DIGITALOCEAN_SSH_KEY_IDS="970381" + # DIGITALOCEAN_ACCESS_TOKEN + - secure: "LYbpXAi9+TuzF4kuMiJTXKbgqnPGkokdX0dm+REduODCzORbPlmcfhdJNSpbYOE+PAM9uqjtAlHiuZQ5dvHdP7HgELcFFOhFEvjCWGypxBBMCNbBp6BCMX2wkUPgATqdkyEMsznCQEDbtK61OuJAMT082X7DQVo1qwWnsEmx8cAsIy9hw1c6yXGMDM8nv3ymSwu9FyQ6Vje8d0ZzLy06OkRs8T60LekzZBBus5wESRf0E8wy4I51qLZbndkCgLA/WyAKpK5rczJP3Ve5DNbMBJHyyYILYN7vKyb0JlOdI97juqa6bJYcsBA2EmpYISfWEzTW4hd5hPModqzjHxHPGada4y7rE7w6FEAXO4N/flxJe/tFe2/fHs8sLO3b8awh3YWVJ0FMP/gl8biXAc42DSiF9flMRc9eM0bqDqijOmK+LLL3FoIP7nRnvF2evcZ6bdLkNH9MnkomCliAovPfaDfD4UQXkRN5Nl5HwcIhCvve3j6Uq7o633r409R6Qc5k1ri63FIya/Iyddo4jHYperSv6/ISgwdfGGeRBpP7cZJ/ZA+tCRdQFjELwjG91Pen4im59qjc2IkVV+XrKhde7Hpl4PgiRDeWW230v8obS4Y31iL/usMm1c1UIgW2azrS7TaFdMJBmLOaO68eRJpyyqz5pGZ5tSgWMNaogD/Am5M=" + +before_install: + # Decrypt pre-generated private key + # See: http://docs.travis-ci.com/user/encrypting-files/ +- openssl aes-256-cbc -K $encrypted_370ffe2e34a2_key -iv $encrypted_370ffe2e34a2_iv -in test/support/travis_id_rsa.key.enc -out ~/.ssh/id_rsa -d +- chmod 600 ~/.ssh/id_rsa + # Re-generate public key from private +- ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub + before_script: - - bundle exec berks install +- cp .kitchen.travis.yml .kitchen.local.yml + script: - - bundle exec rake travis +- bundle exec rake style:ruby +- bundle exec rake style:chef +- bundle exec kitchen create +- bundle exec kitchen converge +- bundle exec kitchen verify + +after_failure: +- cat .kitchen/logs/*.log + +after_script: +- bundle exec kitchen destroy + +branches: + only: + - master + +notifications: + email: false diff --git a/Gemfile b/Gemfile index 7c7cc5a..c0b866b 100644 --- a/Gemfile +++ b/Gemfile @@ -13,6 +13,7 @@ group :test do end group :integration do + gem 'kitchen-digitalocean' gem 'busser-serverspec', '~> 0.2.6' gem 'kitchen-vagrant', '~> 0.15' gem 'test-kitchen', '~> 1.3' diff --git a/test/support/travis_id_rsa.key.enc b/test/support/travis_id_rsa.key.enc new file mode 100644 index 0000000000000000000000000000000000000000..d6b81f53b19867e08dd4dde9d55755230aed2b25 GIT binary patch literal 1680 zcmV;B25yMKOm-_j;$+&-lW$4sVh8u@-U00hkc5Uo!+#vMV61R${G11xG>yD7W&hacW`+ih% zP_x_fnY7cU4+L1lkB6U{rwdK^mh;9z>nKKB$y+!^X!4`Lb%~!8$6z#0453=L^v1Et zE`BooAh6Ap#LPVN?GhCy&2AIt%tgXen~&y@TD;@HjlO7b{F6(2^;=u(?QbBmv1C7F z`YwrKp@j}*6A)}SWa{0rwtlZ}=G>*Any6F#`FnLzz96Tg>^#KGC2F$GW`6jOxQQHlfiYvA{9`ZgmV6(|a ztW2pku+A3AO_d@YFBEyc?dImktkbT0>6e6=duyb@@u)!Egm)hYn1&k|D*hsT3 zT7ywSjC~IQ!XPfm`iAmgX}O^-^g|(QRtOokUx;36+y||ON?nf3d-tEG758<!1TJ1 zdN>!Y77sFpW!29v48N7q#;kSAY1OQY4eos+_zcqbcu!MgMV>)fY^Yp3EHNygdS1B` z)L<7dxIa~=BR#duq^Cp0ZhOBGHK<3ZUJtL7tiRqwd(qVi68S4kps)*!1hlQ)?^{D_ z0(5JY0$ok71UHBrSKjA?2qjRmJAxxGip=)S*+r53_T%n2w>W63 zFuI}mD1Nk9V|%>aZU)f>_^r)pWMuRCvaiUjXrJZes32SIR>lIAlng_7rBv1hTOo*s zZ;d<^Z7KOmB_N}RB~ZyztEUB(?(s}wd42Xl&k@ai$Egb5yNy^Wm2q$Nby$N5TV5T9 zhAMl8y*!9*!uC+w_8sAGmN|!!+<)FUE4BmVA>rk*d6wrObxpY9oIXarZEEL0z__ZZ zf{kPqA|4#SbK#zZGuM?2WQe&4OFm+{k@7x}mx*$k`0hoUxDAOy`l>4M{ar>NVAq)P zBoN?^;s?xYlbX(3J5Hz9K$&!9`zO;MCilF=QNpQU(mFfFjHoN^fs937wTE|ZNKnMA zuM{D3I+^ohX-sO&$M;uqZL&$f7H}Q)qIR86AMvU?Au!}JWY%p;MkH5`lP=zh%MfIk zZZT(0VwSrF(h#*4$8v+)Z2DtoW~M1_Ist|MiBpu495ONe^^2#MExX3B&qCA*ZN)Ku z?`c{tNjG>E=46WDp~eI3)VyVvO4Pp46#udhdTT}W#JFRpjQ>t5K~P+cKOREXYXI8) zRiIZ+>fZFQtc;y){@MOe`RN>E!1@jxs77hm+rNHb!Vf5S=e>E zM0bF9{tT426OhV`lk5a&ly=~Czhs^Qqd6^xSRg5am!?COa#jAUS>Ex>v~y>d2Yr(; zMm@mbHCwinq%1?&=0nk+0k-pM!+D!dzQ4&&Ik0m{d4}}Ln@(ZbB-Hb`9u|P1SenBK zM2KLJe0q)3Xw=X}+uj1t-CXxyr9!g+%DbcG&&$XpDF%6BqoU{~@1~DWRJi z_?|mOcyH}SJcoUv^_=ZL(Fo<3;1F=bzgPIWpADq-%`=?tX&*RH>Vc3CLPN~C6kW;U z%Q!J$^ruGta$3+)Xij8>hvMWx3C|*2M}B^aapZQKJp5sjxKiviFP&&`{DUBImOtUd z_lSa5^jigD3uF9nQ98?>QenI=9<}GHJA^{kTAp6{b3#Sv)wzFgcR*aQB^lLTPycmq zOMju|ow2qF++W3y7-qPX-MER9$-=CRnr8dy2|@ca;>v7I{L#4LSosnkawv!O`ysm* zZ!#9DwN0YCFI$&#qROF-jnE~?b95zSJPVy5vs-nS>0HCiVC literal 0 HcmV?d00001 From 217116284c514d92d8a88a126b4eea64175eab37 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Thu, 9 Jul 2015 17:38:41 -0400 Subject: [PATCH 02/26] Added inline hint for DigitalOcean SSH key IDs. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index ae72f54..592d3c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ rvm: env: global: # Uses public key of private keypair set up in `before_install` task. + # Hint: Inspect SSH key edit buttons in DigitalOcean web interface for IDs. - DIGITALOCEAN_SSH_KEY_IDS="970381" # DIGITALOCEAN_ACCESS_TOKEN - secure: "LYbpXAi9+TuzF4kuMiJTXKbgqnPGkokdX0dm+REduODCzORbPlmcfhdJNSpbYOE+PAM9uqjtAlHiuZQ5dvHdP7HgELcFFOhFEvjCWGypxBBMCNbBp6BCMX2wkUPgATqdkyEMsznCQEDbtK61OuJAMT082X7DQVo1qwWnsEmx8cAsIy9hw1c6yXGMDM8nv3ymSwu9FyQ6Vje8d0ZzLy06OkRs8T60LekzZBBus5wESRf0E8wy4I51qLZbndkCgLA/WyAKpK5rczJP3Ve5DNbMBJHyyYILYN7vKyb0JlOdI97juqa6bJYcsBA2EmpYISfWEzTW4hd5hPModqzjHxHPGada4y7rE7w6FEAXO4N/flxJe/tFe2/fHs8sLO3b8awh3YWVJ0FMP/gl8biXAc42DSiF9flMRc9eM0bqDqijOmK+LLL3FoIP7nRnvF2evcZ6bdLkNH9MnkomCliAovPfaDfD4UQXkRN5Nl5HwcIhCvve3j6Uq7o633r409R6Qc5k1ri63FIya/Iyddo4jHYperSv6/ISgwdfGGeRBpP7cZJ/ZA+tCRdQFjELwjG91Pen4im59qjc2IkVV+XrKhde7Hpl4PgiRDeWW230v8obS4Y31iL/usMm1c1UIgW2azrS7TaFdMJBmLOaO68eRJpyyqz5pGZ5tSgWMNaogD/Am5M=" From e922cd06e867b26189ebb20912ec72bd0dbc6558 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Thu, 9 Jul 2015 17:39:09 -0400 Subject: [PATCH 03/26] Converted 'empty?' methods in template into booleans. When an attr is nil, it doesn't have this method and fails. This no longer detects empty strings, but that's probably not something to rely on anyhow. --- templates/default/web_app.conf.erb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/templates/default/web_app.conf.erb b/templates/default/web_app.conf.erb index cc28e81..e30e555 100644 --- a/templates/default/web_app.conf.erb +++ b/templates/default/web_app.conf.erb @@ -3,10 +3,10 @@ # Local modifications will be overwritten by Chef. # > - <% unless node['stash']['apache2']['virtual_host_name'].empty? -%> + <% if node['stash']['apache2']['virtual_host_name'] -%> ServerName <%= node['stash']['apache2']['virtual_host_name'] %> <% end -%> - <% unless node['stash']['apache2']['virtual_host_alias'].empty? -%> + <% if node['stash']['apache2']['virtual_host_alias'] -%> <% virtual_host_aliases = node['stash']['apache2']['virtual_host_alias'].kind_of?(Array) ? node['stash']['apache2']['virtual_host_alias'] : [ node['stash']['apache2']['virtual_host_alias'] ] -%> <% virtual_host_aliases.each do |virtual_host_alias| -%> ServerAlias <%= virtual_host_alias %> @@ -14,8 +14,8 @@ <% end -%> DocumentRoot <%= node['stash']['install_path'] %> - CustomLog <%= node['stash']['apache2']['access_log'].empty? ? node['apache']['log_dir']+"/stash-access.log" : node['stash']['apache2']['access_log'] %> combined - ErrorLog <%= node['stash']['apache2']['error_log'].empty? ? node['apache']['log_dir']+"/stash-error.log" : node['stash']['apache2']['error_log'] %> + CustomLog <%= node['stash']['apache2']['access_log'] ? node['stash']['apache2']['access_log'] : "#{node['apache']['log_dir']}/stash-access.log" %> combined + ErrorLog <%= node['stash']['apache2']['error_log'] ? node['stash']['apache2']['error_log'] : "#{node['apache']['log_dir']}/stash-error.log" %> LogLevel warn @@ -31,10 +31,10 @@ > - <% unless node['stash']['apache2']['virtual_host_name'].empty? -%> + <% if node['stash']['apache2']['virtual_host_name'] -%> ServerName <%= node['stash']['apache2']['virtual_host_name'] %> <% end -%> - <% unless node['stash']['apache2']['virtual_host_alias'].empty? -%> + <% if node['stash']['apache2']['virtual_host_alias'] -%> <% virtual_host_aliases = node['stash']['apache2']['virtual_host_alias'].kind_of?(Array) ? node['stash']['apache2']['virtual_host_alias'] : [ node['stash']['apache2']['virtual_host_alias'] ] -%> <% virtual_host_aliases.each do |virtual_host_alias| -%> ServerAlias <%= virtual_host_alias %> @@ -42,8 +42,8 @@ <% end -%> DocumentRoot <%= node['stash']['install_path'] %> - CustomLog <%= node['stash']['apache2']['ssl']['access_log'].empty? ? node['apache']['log_dir']+"/stash-ssl-access.log" : node['stash']['apache2']['ssl']['access_log'] %> combined - ErrorLog <%= node['stash']['apache2']['ssl']['error_log'].empty? ? node['apache']['log_dir']+"/stash-ssl-error.log" : node['stash']['apache2']['ssl']['error_log'] %> + CustomLog <%= node['stash']['apache2']['ssl']['access_log'] ? node['stash']['apache2']['ssl']['access_log'] : "#{node['apache']['log_dir']}/stash-ssl-access.log" %> combined + ErrorLog <%= node['stash']['apache2']['ssl']['error_log'] ? node['stash']['apache2']['ssl']['error_log'] : "#{node['apache']['log_dir']}/stash-ssl-error.log" %> LogLevel warn @@ -60,7 +60,7 @@ SSLEngine on SSLCertificateFile <%= node['stash']['apache2']['ssl']['certificate_file'] %> SSLCertificateKeyFile <%= node['stash']['apache2']['ssl']['key_file'] %> - <% unless node['stash']['apache2']['ssl']['chain_file'].empty? -%> + <% if node['stash']['apache2']['ssl']['chain_file'] -%> SSLCertificateChainFile <%= node['stash']['apache2']['ssl']['chain_file'] %> <% end -%> From 67ac33ac41b964c684bb51622d6300523702593e Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Thu, 9 Jul 2015 17:50:56 -0400 Subject: [PATCH 04/26] Added chef-sugar cookbook for access to #blank? helper. --- metadata.rb | 1 + templates/default/web_app.conf.erb | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/metadata.rb b/metadata.rb index 4d3dfc0..86f1847 100644 --- a/metadata.rb +++ b/metadata.rb @@ -23,6 +23,7 @@ depends 'apache2' depends 'ark' +depends 'chef-sugar', '> 1.3.0' depends 'cron' depends 'database' depends 'git' diff --git a/templates/default/web_app.conf.erb b/templates/default/web_app.conf.erb index e30e555..2d48d6a 100644 --- a/templates/default/web_app.conf.erb +++ b/templates/default/web_app.conf.erb @@ -3,10 +3,10 @@ # Local modifications will be overwritten by Chef. # > - <% if node['stash']['apache2']['virtual_host_name'] -%> + <% unless node['stash']['apache2']['virtual_host_name'].blank? -%> ServerName <%= node['stash']['apache2']['virtual_host_name'] %> <% end -%> - <% if node['stash']['apache2']['virtual_host_alias'] -%> + <% unless node['stash']['apache2']['virtual_host_alias'].blank? -%> <% virtual_host_aliases = node['stash']['apache2']['virtual_host_alias'].kind_of?(Array) ? node['stash']['apache2']['virtual_host_alias'] : [ node['stash']['apache2']['virtual_host_alias'] ] -%> <% virtual_host_aliases.each do |virtual_host_alias| -%> ServerAlias <%= virtual_host_alias %> @@ -14,8 +14,8 @@ <% end -%> DocumentRoot <%= node['stash']['install_path'] %> - CustomLog <%= node['stash']['apache2']['access_log'] ? node['stash']['apache2']['access_log'] : "#{node['apache']['log_dir']}/stash-access.log" %> combined - ErrorLog <%= node['stash']['apache2']['error_log'] ? node['stash']['apache2']['error_log'] : "#{node['apache']['log_dir']}/stash-error.log" %> + CustomLog <%= node['stash']['apache2']['access_log'].blank? ? node['apache']['log_dir']+"/stash-access.log" : node['stash']['apache2']['access_log'] %> combined + ErrorLog <%= node['stash']['apache2']['error_log'].blank? ? node['apache']['log_dir']+"/stash-error.log" : node['stash']['apache2']['error_log'] %> LogLevel warn @@ -31,10 +31,10 @@ > - <% if node['stash']['apache2']['virtual_host_name'] -%> + <% unless node['stash']['apache2']['virtual_host_name'].blank? -%> ServerName <%= node['stash']['apache2']['virtual_host_name'] %> <% end -%> - <% if node['stash']['apache2']['virtual_host_alias'] -%> + <% unless node['stash']['apache2']['virtual_host_alias'].blank? -%> <% virtual_host_aliases = node['stash']['apache2']['virtual_host_alias'].kind_of?(Array) ? node['stash']['apache2']['virtual_host_alias'] : [ node['stash']['apache2']['virtual_host_alias'] ] -%> <% virtual_host_aliases.each do |virtual_host_alias| -%> ServerAlias <%= virtual_host_alias %> @@ -42,8 +42,8 @@ <% end -%> DocumentRoot <%= node['stash']['install_path'] %> - CustomLog <%= node['stash']['apache2']['ssl']['access_log'] ? node['stash']['apache2']['ssl']['access_log'] : "#{node['apache']['log_dir']}/stash-ssl-access.log" %> combined - ErrorLog <%= node['stash']['apache2']['ssl']['error_log'] ? node['stash']['apache2']['ssl']['error_log'] : "#{node['apache']['log_dir']}/stash-ssl-error.log" %> + CustomLog <%= node['stash']['apache2']['ssl']['access_log'].blank? ? node['apache']['log_dir']+"/stash-ssl-access.log" : node['stash']['apache2']['ssl']['access_log'] %> combined + ErrorLog <%= node['stash']['apache2']['ssl']['error_log'].blank? ? node['apache']['log_dir']+"/stash-ssl-error.log" : node['stash']['apache2']['ssl']['error_log'] %> LogLevel warn @@ -60,7 +60,7 @@ SSLEngine on SSLCertificateFile <%= node['stash']['apache2']['ssl']['certificate_file'] %> SSLCertificateKeyFile <%= node['stash']['apache2']['ssl']['key_file'] %> - <% if node['stash']['apache2']['ssl']['chain_file'] -%> + <% unless node['stash']['apache2']['ssl']['chain_file'].blank? -%> SSLCertificateChainFile <%= node['stash']['apache2']['ssl']['chain_file'] %> <% end -%> From fa7125e2dda55ba9d16fec7a82264b2d02cba62c Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Thu, 9 Jul 2015 17:55:44 -0400 Subject: [PATCH 05/26] Oops. Forgot to add travis kitchen.yml. --- .kitchen.travis.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .kitchen.travis.yml diff --git a/.kitchen.travis.yml b/.kitchen.travis.yml new file mode 100644 index 0000000..59a50d3 --- /dev/null +++ b/.kitchen.travis.yml @@ -0,0 +1,17 @@ +driver: + name: digitalocean + private_networking: false + +platforms: +- name: centos-6 + driver_config: + image: centos-6-5-x64 +- name: centos-7 + driver_config: + image: centos-7-0-x64 +- name: ubuntu-12.04 + driver_config: + image: ubuntu-12-04-x64 +- name: ubuntu-14.04 + driver_config: + image: ubuntu-14-04-x64 From dd38fbdfa547ca77ebffaced75ec7dbc02d0e19d Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Thu, 9 Jul 2015 18:09:35 -0400 Subject: [PATCH 06/26] Installed chef-sugar properly. --- recipes/default.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/default.rb b/recipes/default.rb index 87a439b..dc405a5 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -9,6 +9,9 @@ end include_recipe 'perl' +include_recipe 'chef-sugar::default' +require 'chef/sugar/core_extensions' + include_recipe 'stash::database' if settings['database']['host'] == '127.0.0.1' include_recipe "stash::#{platform}_#{node['stash']['install_type']}" include_recipe 'stash::configuration' From 279c2214f130f775f2434f7cf742fe5c664c18c1 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Thu, 9 Jul 2015 18:42:44 -0400 Subject: [PATCH 07/26] Make sure java memory settings match digitalocean image's. --- .kitchen.travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.kitchen.travis.yml b/.kitchen.travis.yml index 59a50d3..c88add2 100644 --- a/.kitchen.travis.yml +++ b/.kitchen.travis.yml @@ -1,9 +1,17 @@ driver: name: digitalocean private_networking: false + size: 512mb + +cloud_attributes: &CLOUD_ATTRIBUTES + stash: + jvm: + maximum_memory: 512m + maximum_permgen: 512m platforms: - name: centos-6 + attributes: *CLOUD_ATTRIBUTES driver_config: image: centos-6-5-x64 - name: centos-7 From 104548cc256bc100783d5a7dbcc7aabf8786e60d Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Thu, 9 Jul 2015 22:32:08 -0400 Subject: [PATCH 08/26] Build just feature branch for testing. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 592d3c0..07eafc5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,7 +39,7 @@ after_script: branches: only: - - master + - feature/108-test-kitchen-cloud notifications: email: false From 6161e7f1603b993691c12dae49387c699c83ab98 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Fri, 10 Jul 2015 00:04:02 -0400 Subject: [PATCH 09/26] Bumped cloud test image size to 1024 mb. --- .kitchen.travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.kitchen.travis.yml b/.kitchen.travis.yml index c88add2..830f295 100644 --- a/.kitchen.travis.yml +++ b/.kitchen.travis.yml @@ -1,13 +1,12 @@ driver: name: digitalocean private_networking: false - size: 512mb + size: 1024mb cloud_attributes: &CLOUD_ATTRIBUTES stash: jvm: - maximum_memory: 512m - maximum_permgen: 512m + maximum_memory: 1024m platforms: - name: centos-6 From d054ca394a441ba9d3dd92d2e0646e95ae93b204 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Fri, 10 Jul 2015 00:04:56 -0400 Subject: [PATCH 10/26] Fixed up cruft from old mysql cookbook attributes. --- .kitchen.yml | 7 +++---- recipes/database.rb | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.kitchen.yml b/.kitchen.yml index f803cb6..60a89db 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -45,10 +45,9 @@ suites: - recipe[stash] attributes: <<: *DEFAULT_ATTRIBUTES - mysql: - server_root_password: iloverandompasswordsbutthiswilldo - server_repl_password: iloverandompasswordsbutthiswilldo - server_debian_password: iloverandompasswordsbutthiswilldo + stash: + database: + password: iloverandompasswordsbutthiswilldo - name: postgresql run_list: - recipe[test-helper] diff --git a/recipes/database.rb b/recipes/database.rb index d23cb73..90a1d61 100644 --- a/recipes/database.rb +++ b/recipes/database.rb @@ -17,12 +17,11 @@ bind_address settings['database']['host'] # See: https://github.com/chef-cookbooks/mysql/pull/361 port settings['database']['port'].to_s - data_dir node['mysql']['data_dir'] if node['mysql']['data_dir'] - initial_root_password node['mysql']['server_root_password'] + initial_root_password settings['database']['password'] action [:create, :start] end - database_connection.merge!(:username => 'root', :password => node['mysql']['server_root_password']) + database_connection.merge!(:username => 'root', :password => settings['database']['password']) mysql_database settings['database']['name'] do connection database_connection From e00fb5690ddf5871adf5d98c2c24bd7721f48175 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Fri, 10 Jul 2015 14:53:25 -0400 Subject: [PATCH 11/26] Added more digitalocean memory for testing. --- .kitchen.travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.kitchen.travis.yml b/.kitchen.travis.yml index 830f295..41f340e 100644 --- a/.kitchen.travis.yml +++ b/.kitchen.travis.yml @@ -1,7 +1,7 @@ driver: name: digitalocean private_networking: false - size: 1024mb + size: 1gb cloud_attributes: &CLOUD_ATTRIBUTES stash: @@ -14,11 +14,14 @@ platforms: driver_config: image: centos-6-5-x64 - name: centos-7 + attributes: *CLOUD_ATTRIBUTES driver_config: image: centos-7-0-x64 - name: ubuntu-12.04 + attributes: *CLOUD_ATTRIBUTES driver_config: image: ubuntu-12-04-x64 - name: ubuntu-14.04 + attributes: *CLOUD_ATTRIBUTES driver_config: image: ubuntu-14-04-x64 From bc6f3e2803de3ff9d0dea9e8a8b427e5157a2dbc Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Fri, 10 Jul 2015 16:06:22 -0400 Subject: [PATCH 12/26] Added paralellism and envvar check to cloud integration tests. --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 07eafc5..089b92d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,9 +27,7 @@ before_script: script: - bundle exec rake style:ruby - bundle exec rake style:chef -- bundle exec kitchen create -- bundle exec kitchen converge -- bundle exec kitchen verify +- '[ "${TRAVIS_SECURE_ENV_VARS}" = "true" ] && bundle exec kitchen test --parallel' after_failure: - cat .kitchen/logs/*.log From 20d1ee0d6c88717b8ab10f12bad4c9a97a20401d Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Mon, 13 Jul 2015 23:57:19 -0400 Subject: [PATCH 13/26] Added package manager recipes to local override platforms. --- .kitchen.travis.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.kitchen.travis.yml b/.kitchen.travis.yml index 41f340e..4886808 100644 --- a/.kitchen.travis.yml +++ b/.kitchen.travis.yml @@ -9,19 +9,31 @@ cloud_attributes: &CLOUD_ATTRIBUTES maximum_memory: 1024m platforms: + - name: centos-6 attributes: *CLOUD_ATTRIBUTES driver_config: image: centos-6-5-x64 + run_list: + - recipe[yum] + - name: centos-7 attributes: *CLOUD_ATTRIBUTES driver_config: image: centos-7-0-x64 + run_list: + - recipe[yum] + - name: ubuntu-12.04 attributes: *CLOUD_ATTRIBUTES driver_config: image: ubuntu-12-04-x64 + run_list: + - recipe[apt] + - name: ubuntu-14.04 attributes: *CLOUD_ATTRIBUTES driver_config: image: ubuntu-14-04-x64 + run_list: + - recipe[apt] From e298f33dfe67a525b1c574dbe6aeb2aee096fd6c Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Mon, 13 Jul 2015 23:59:36 -0400 Subject: [PATCH 14/26] Force apt update at compiletime * postgresql::ruby requires build-essential to run at compile time, and so it also needs apt repos updated. --- .kitchen.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.kitchen.yml b/.kitchen.yml index 60a89db..bf8b2fb 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -30,6 +30,8 @@ platforms: - recipe[apt] default_attributes: &DEFAULT_ATTRIBUTES + apt: + compile_time_update: true java: install_flavor: oracle java_home: /usr/lib/jvm/java-7-oracle From 3de36f18f755a41011792fcc038cf86d2f313bf9 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Tue, 14 Jul 2015 00:06:26 -0400 Subject: [PATCH 15/26] Start using chef_zero provisioner. --- .kitchen.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.kitchen.yml b/.kitchen.yml index bf8b2fb..1f9d802 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -7,6 +7,9 @@ driver_config: customize: memory: 1024 +provisioner: + name: chef_zero + platforms: - name: centos-6 driver_config: From 7cdec891e243e56504124102f83eda1adb28c2e3 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Tue, 14 Jul 2015 00:22:10 -0400 Subject: [PATCH 16/26] Test against Chef 12.4.1. --- .kitchen.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.kitchen.yml b/.kitchen.yml index 1f9d802..430d2c6 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -1,7 +1,7 @@ --- driver: name: vagrant - require_chef_omnibus: 11.16.2 + require_chef_omnibus: 12.4.1 driver_config: customize: From d3c1034bdd029b172c5de62cd14aa4b8757029cf Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Tue, 14 Jul 2015 00:22:41 -0400 Subject: [PATCH 17/26] Removed compiletime build-essential, as this is handled by postgresql::ruby. --- attributes/default.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index d727bc5..096419c 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -1,5 +1,3 @@ -set['build_essential']['compiletime'] = true - default['stash']['home_path'] = '/var/atlassian/application-data/stash' default['stash']['install_path'] = '/opt/atlassian' default['stash']['install_type'] = 'standalone' From b010beaba1283ae50f65a2e463ad886fcf6a6c55 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Tue, 14 Jul 2015 00:59:39 -0400 Subject: [PATCH 18/26] Updated README badge for now. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index df19d68..349d7a3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# chef-stash [![Build Status](https://secure.travis-ci.org/bflad/chef-stash.png?branch=master)](http://travis-ci.org/bflad/chef-stash) +# chef-stash [![Build Status](https://secure.travis-ci.org/patcon/chef-stash.png?branch=feature/108-test-kitchen-cloud)](http://travis-ci.org/patcon/chef-stash) ##![](https://assets-cdn.github.com/images/icons/emoji/unicode/2757.png) We are preparing for 4.0.0 release which makes the git repo not stable for now. Please use cookbook from [Supermarket](https://supermarket.chef.io/cookbooks/stash/) for the time being. From 984e27c8e517dfdf1f7848cee055986402a97000 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Tue, 14 Jul 2015 01:11:04 -0400 Subject: [PATCH 19/26] Output instance listing for failure clarity. [ci skip] --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 089b92d..8c93308 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,9 +30,10 @@ script: - '[ "${TRAVIS_SECURE_ENV_VARS}" = "true" ] && bundle exec kitchen test --parallel' after_failure: -- cat .kitchen/logs/*.log +# - cat .kitchen/logs/*.log after_script: +- bundle exec kitchen list - bundle exec kitchen destroy branches: From 9ce5df7f899a42fa4e28b66fb436d37eef862418 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Tue, 14 Jul 2015 02:19:46 -0400 Subject: [PATCH 20/26] Reverted back to using Chef 11 for less verbose logs. Long logs (4MB+) make Travis thing that it's in a loop, and it will cancel the build job. We seem to hit this with the verbosity of chef 12. --- .kitchen.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.kitchen.yml b/.kitchen.yml index 430d2c6..18448e6 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -1,7 +1,7 @@ --- driver: name: vagrant - require_chef_omnibus: 12.4.1 + require_chef_omnibus: 11.18.14 driver_config: customize: From feff06a1625a23cc3bfdebfe28bea3122f4c449c Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Tue, 14 Jul 2015 12:00:13 -0400 Subject: [PATCH 21/26] Moved to using an omnibus version that is exists. --- .kitchen.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.kitchen.yml b/.kitchen.yml index 18448e6..67fe2eb 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -1,7 +1,7 @@ --- driver: name: vagrant - require_chef_omnibus: 11.18.14 + require_chef_omnibus: 11.18.12 driver_config: customize: From c5041bc86b2674839bb976b2778c3705563ab29c Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Tue, 14 Jul 2015 15:59:57 -0400 Subject: [PATCH 22/26] Use minimal formatter on travis cloud tests. Travis CI will cancel jobs when the logs get over 4MB, so this helps avoid that. --- .kitchen.travis.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.kitchen.travis.yml b/.kitchen.travis.yml index 4886808..47da9b2 100644 --- a/.kitchen.travis.yml +++ b/.kitchen.travis.yml @@ -3,36 +3,37 @@ driver: private_networking: false size: 1gb -cloud_attributes: &CLOUD_ATTRIBUTES - stash: - jvm: - maximum_memory: 1024m +provisioner: + client_rb: + formatters: + # Travis CI will cancel job if logs get over 4MB. + - :minimal + attributes: + stash: + jvm: + maximum_memory: 1024m platforms: - name: centos-6 - attributes: *CLOUD_ATTRIBUTES driver_config: image: centos-6-5-x64 run_list: - recipe[yum] - name: centos-7 - attributes: *CLOUD_ATTRIBUTES driver_config: image: centos-7-0-x64 run_list: - recipe[yum] - name: ubuntu-12.04 - attributes: *CLOUD_ATTRIBUTES driver_config: image: ubuntu-12-04-x64 run_list: - recipe[apt] - name: ubuntu-14.04 - attributes: *CLOUD_ATTRIBUTES driver_config: image: ubuntu-14-04-x64 run_list: From 355f96d8bb6cdf37180322103db58439db5f17e9 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Tue, 14 Jul 2015 16:00:49 -0400 Subject: [PATCH 23/26] Cleaned up kitchen.yml merging. --- .kitchen.yml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.kitchen.yml b/.kitchen.yml index 67fe2eb..dfb8e78 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -9,18 +9,30 @@ driver_config: provisioner: name: chef_zero + attributes: + apt: + compile_time_update: true + java: + install_flavor: oracle + java_home: /usr/lib/jvm/java-7-oracle + jdk_version: 7 + oracle: + accept_oracle_download_terms: true platforms: + - name: centos-6 driver_config: box: chef/centos-6.6 run_list: - recipe[yum] + - name: centos-7 driver_config: box: chef/centos-7.0 run_list: - recipe[yum] + - name: ubuntu-12.04 driver_config: box: chef/ubuntu-12.04 @@ -32,16 +44,6 @@ platforms: run_list: - recipe[apt] -default_attributes: &DEFAULT_ATTRIBUTES - apt: - compile_time_update: true - java: - install_flavor: oracle - java_home: /usr/lib/jvm/java-7-oracle - jdk_version: 7 - oracle: - accept_oracle_download_terms: true - suites: - name: mysql # default run_list: @@ -49,17 +51,16 @@ suites: - recipe[java] - recipe[stash] attributes: - <<: *DEFAULT_ATTRIBUTES stash: database: password: iloverandompasswordsbutthiswilldo + - name: postgresql run_list: - recipe[test-helper] - recipe[java] - recipe[stash] attributes: - <<: *DEFAULT_ATTRIBUTES stash: database: type: postgresql From 560596930e4cb35cb79097872dad12118053750d Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Tue, 14 Jul 2015 16:14:16 -0400 Subject: [PATCH 24/26] Simplified kitchen.yml setup. --- .kitchen.travis.yml | 26 -------------------------- .kitchen.yml | 7 ++++++- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/.kitchen.travis.yml b/.kitchen.travis.yml index 47da9b2..15fe7dd 100644 --- a/.kitchen.travis.yml +++ b/.kitchen.travis.yml @@ -12,29 +12,3 @@ provisioner: stash: jvm: maximum_memory: 1024m - -platforms: - -- name: centos-6 - driver_config: - image: centos-6-5-x64 - run_list: - - recipe[yum] - -- name: centos-7 - driver_config: - image: centos-7-0-x64 - run_list: - - recipe[yum] - -- name: ubuntu-12.04 - driver_config: - image: ubuntu-12-04-x64 - run_list: - - recipe[apt] - -- name: ubuntu-14.04 - driver_config: - image: ubuntu-14-04-x64 - run_list: - - recipe[apt] diff --git a/.kitchen.yml b/.kitchen.yml index dfb8e78..604fd1e 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -23,24 +23,29 @@ platforms: - name: centos-6 driver_config: - box: chef/centos-6.6 + box: chef/centos-6.6 # vagrant + image: centos-6-5-x64 # digitalocean run_list: - recipe[yum] - name: centos-7 driver_config: box: chef/centos-7.0 + image: centos-7-0-x64 run_list: - recipe[yum] - name: ubuntu-12.04 driver_config: box: chef/ubuntu-12.04 + image: ubuntu-12-04-x64 run_list: - recipe[apt] + - name: ubuntu-14.04 driver_config: box: chef/ubuntu-14.04 + image: ubuntu-14-04-x64 run_list: - recipe[apt] From 3f08d7fcf448909fbe5fdc459e740f61da431c1e Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Tue, 14 Jul 2015 16:29:58 -0400 Subject: [PATCH 25/26] Clean up travis.yml. [ci skip] --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8c93308..ac9cae8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,9 +29,6 @@ script: - bundle exec rake style:chef - '[ "${TRAVIS_SECURE_ENV_VARS}" = "true" ] && bundle exec kitchen test --parallel' -after_failure: -# - cat .kitchen/logs/*.log - after_script: - bundle exec kitchen list - bundle exec kitchen destroy From 0674296c6c4a862ecfe551c73a4e2561e85ca50a Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Tue, 14 Jul 2015 16:48:41 -0400 Subject: [PATCH 26/26] Added note about node.apt.compile_time_update [ci skip] --- .kitchen.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.kitchen.yml b/.kitchen.yml index 604fd1e..822f046 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -11,6 +11,7 @@ provisioner: name: chef_zero attributes: apt: + # Some other cookbook's compile_time nonsense requires this... :/ compile_time_update: true java: install_flavor: oracle