itamae-plugin-recipe-redmine 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 9739cdd7f6ee58fb61d9f2c89a842fee1d5ac5c16be953a3dce0f617d07e63db
4
- data.tar.gz: 524269e78188dabbb8d19e9f3eb1585edf9b7bb5ae1d3556eb852e8bc3a0a7c5
2
+ SHA1:
3
+ metadata.gz: 63b19e4bd5ad23bdb28976bbe3e94bf37881dcb2
4
+ data.tar.gz: 885b826c67c956a78b76dd96d900c5b18be3d4f3
5
5
  SHA512:
6
- metadata.gz: d27839409fe28f6801db64209710dd59c301515c2d775058db916d43ef9509a8b46f2ddb53e9eeb972be344e0115983aaf498abb598b50288bc82c4cd101f929
7
- data.tar.gz: 967461201bab722ba667eac5e8d92aae7c633f2901cf61682f1fada599074b66953d7aa7bf696d8ea43e233aacb830aa72423cb53f1e64025a189dd590b67b67
6
+ metadata.gz: 3bb287b2d5deabb824b4ef75cbe246160efa32a236d52628cd2e5dd1be4b885aa54aa5bcc059534c832f4ac978bffb77eb9a92e3052fec500f11d21204ef7035
7
+ data.tar.gz: aa94ae11a8a671b65ed5897eef3f6c307405d4c96667aad897fe4b997ab52570ea901651f20248e7f476fd2c176988510eb9f13892c0269f90945f43e2ad0e52
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.require_paths = ["lib"]
24
24
 
25
25
  spec.add_dependency 'itamae', '~> 1.10', '>= 1.10.2'
26
+ spec.add_dependency 'itamae-plugin-recipe-postgresql', '~> 0', '>= 0.0.1'
26
27
 
27
28
  spec.add_development_dependency "bundler", "~> 1.17"
28
29
  spec.add_development_dependency "rake", "~> 10.0"
@@ -0,0 +1,14 @@
1
+ #!/bin/bash
2
+
3
+ expect -c "
4
+ set timeout 5
5
+ spawn LANG=en.en_US createuser -P redmine
6
+
7
+ expect \"Enter password for new role\"
8
+ send \"$1\n\"
9
+
10
+ expect \"Enter it again\"
11
+ send \"$1\n\"
12
+
13
+ interact
14
+ "
@@ -1,10 +1,12 @@
1
- require_relative 'version'
1
+ include_recipe 'postgresql'
2
2
 
3
+ require_relative 'version'
3
4
  version = ENV['REDMINE_VERSION'] || Itamae::Plugin::Recipe::Redmine::REDMINE_VERSION
4
5
 
5
6
  %w{
6
7
  ImageMagick
7
8
  ImageMagick-devel
9
+ expect
8
10
  ipa-pgothic-fonts
9
11
  libcurl-devel
10
12
  libffi-devel
@@ -60,16 +62,30 @@ execute "build redmine-#{version}" do
60
62
  not_if "test -e /opt/redmine/redmine-#{version}/INSTALLED"
61
63
  end
62
64
 
63
- %w{
64
- configuration.yml
65
- database.yml
66
- }.each do |name|
67
- template "/opt/redmine/redmine-#{version}/config/#{name}" do
68
- user 'root'
69
- owner 'redmine'
70
- group 'redmine'
71
- mode '644'
72
- end
65
+ template "/opt/redmine/redmine-#{version}/config/configuration.yml" do
66
+ user 'root'
67
+ owner 'redmine'
68
+ group 'redmine'
69
+ mode '644'
70
+ end
71
+
72
+ template "/opt/redmine/redmine-#{version}/config/database.yml" do
73
+ user 'root'
74
+ owner 'redmine'
75
+ group 'redmine'
76
+ mode '644'
77
+ variables redmine_password: ENV['REDMINE_PASSWORD'] || 'redmine'
78
+ end
79
+
80
+ execute 'createuser' do
81
+ user 'postgres'
82
+ command "#{::File.join(File.dirname(__FILE__), 'create_user.sh')} #{ENV['REDMINE_PASSWORD'] || 'redmine'}"
83
+ not_if "psql -c \"select * from pg_user where usename = 'redmine';\" | grep redmine"
84
+ end
85
+
86
+ execute 'createdb -E UTF-8 -l ja_JP.UTF-8 -O redmine -T template0 redmine' do
87
+ user 'postgres'
88
+ not_if "psql -c \"select * from pg_database where datname = 'redmine';\" | grep redmine"
73
89
  end
74
90
 
75
91
  gem_package 'bundler' do
@@ -78,8 +94,26 @@ gem_package 'bundler' do
78
94
  end
79
95
 
80
96
  execute 'bundle _1.17.3_ install --without development test --path vendor/bundle' do
97
+ user 'redmine'
81
98
  cwd "/opt/redmine/redmine-#{version}"
99
+ command <<-EOF
100
+ set -eu
101
+ bundle _1.17.3_ install --without development test --path vendor/bundle
102
+ touch BUNDLED
103
+ EOF
104
+ not_if "test -e /opt/redmine/redmine-#{version}/BUNDLED"
105
+ end
106
+
107
+ execute 'redmine initialization' do
82
108
  user 'redmine'
109
+ cwd "/opt/redmine/redmine-#{version}"
110
+ command <<-EOF
111
+ set -eu
112
+ bundle exec rake generate_secret_token
113
+ bundle exec rake db:migrate RAILS_ENV=production
114
+ touch INITIALIZED
115
+ EOF
116
+ not_if "test -e /opt/redmine/redmine-#{version}/INITIALIZED"
83
117
  end
84
118
 
85
119
  link 'current' do
@@ -3,4 +3,4 @@ production:
3
3
  database: redmine
4
4
  host: localhost
5
5
  username: redmine
6
- password: redmine
6
+ password: <%%= ENV['REDMINE_PASSWORD'] || '<%= @redmine_password %>' %>
@@ -2,7 +2,7 @@ module Itamae
2
2
  module Plugin
3
3
  module Recipe
4
4
  module Redmine
5
- VERSION = "0.0.1"
5
+ VERSION = "0.0.2"
6
6
 
7
7
  REDMINE_VERSION = [
8
8
  REDMINE_VERSION_MAJOR = '3',
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae-plugin-recipe-redmine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - y-matsuda
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-22 00:00:00.000000000 Z
11
+ date: 2019-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: itamae
@@ -30,6 +30,26 @@ dependencies:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: 1.10.2
33
+ - !ruby/object:Gem::Dependency
34
+ name: itamae-plugin-recipe-postgresql
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 0.0.1
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 0.0.1
33
53
  - !ruby/object:Gem::Dependency
34
54
  name: bundler
35
55
  requirement: !ruby/object:Gem::Requirement
@@ -74,6 +94,7 @@ files:
74
94
  - bin/console
75
95
  - bin/setup
76
96
  - itamae-plugin-recipe-redmine.gemspec
97
+ - lib/itamae/plugin/recipe/redmine/create_user.sh
77
98
  - lib/itamae/plugin/recipe/redmine/default.rb
78
99
  - lib/itamae/plugin/recipe/redmine/redmine-3.4.10_sha256sum.txt
79
100
  - lib/itamae/plugin/recipe/redmine/templates/configuration.yml.erb
@@ -99,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
120
  version: '0'
100
121
  requirements: []
101
122
  rubyforge_project:
102
- rubygems_version: 2.7.8
123
+ rubygems_version: 2.5.2.3
103
124
  signing_key:
104
125
  specification_version: 4
105
126
  summary: itamae recipe to ease redmine installation