capun 0.0.21 → 0.0.23
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
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c6b065c5ffd8c41238ded0c7a8ef01a9d42aa26
|
4
|
+
data.tar.gz: 9c894551307e0ff135d6f50a45620c5d75f1be59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 576ce8084fe50492582b72a38f7bea98ef39fa02b2c2a4c07b6de2ae3966fdaa32743105f466927f6d9466c0b6a34bf6e3180ce1075b830ee16ae21944b8612a
|
7
|
+
data.tar.gz: 6099f03a9449c0b3236e67941ef2e02047ba33b5bf0de40d8e8151d0c374fe7a08782ba1822545cdbd602e46ea8163a8a5855ba3d618afceccd68a0a95c1d048
|
data/lib/capun/setup.rb
CHANGED
@@ -108,6 +108,17 @@ namespace :deploy do
|
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
111
|
+
desc "Checking if Jenkins configuration file"
|
112
|
+
task :check_jenkins_project_existence do
|
113
|
+
on roles(:app) do
|
114
|
+
if fetch(:addJenkins) && test("[ -f /var/lib/jenkins/jobs/#{fetch(:application)}/config.xml ]")
|
115
|
+
set :jenkins_project_exists, true
|
116
|
+
else
|
117
|
+
set :jenkins_project_exists, false
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
111
122
|
desc 'Setting up Jenkins'
|
112
123
|
task :set_up_jenkins do
|
113
124
|
if fetch(:addJenkins)
|
@@ -117,7 +128,7 @@ namespace :deploy do
|
|
117
128
|
execute :sudo, :chmod, "755", "/var/lib/jenkins/jobs/#{fetch(:application)}"
|
118
129
|
execute :sudo, :chown, "jenkins:jenkins", "/var/lib/jenkins/jobs/#{fetch(:application)}/config.xml"
|
119
130
|
execute :sudo, :chmod, "644", "/var/lib/jenkins/jobs/#{fetch(:application)}/config.xml"
|
120
|
-
execute :sudo, "service jenkins restart"
|
131
|
+
execute :sudo, "service jenkins restart" unless fetch(:jenkins_project_exists)
|
121
132
|
end
|
122
133
|
end
|
123
134
|
end
|
@@ -152,6 +163,7 @@ namespace :deploy do
|
|
152
163
|
end
|
153
164
|
|
154
165
|
before "deploy:updating", "deploy:make_dirs"
|
166
|
+
before "deploy:updating", "deploy:check_jenkins_project_existence"
|
155
167
|
after "deploy:symlink:linked_dirs", "deploy:upload"
|
156
168
|
after "deploy:symlink:linked_dirs", "deploy:add_symlinks"
|
157
169
|
after "deploy:publishing", "deploy:set_up_jenkins"
|
data/lib/capun/version.rb
CHANGED
@@ -16,6 +16,9 @@ module Capun
|
|
16
16
|
@password = ask("Basic authentication password [ex.: secret]:")
|
17
17
|
end
|
18
18
|
@addJenkins = ask("Would you like to add Jenkins configuration file? [Y/n]").capitalize == 'Y'
|
19
|
+
if @addJenkins
|
20
|
+
@jenkinsToken = ask("New Jenkins token key:")
|
21
|
+
end
|
19
22
|
@addNewRelic = ask("Would you like to add New Relic configuration file? [Y/n]").capitalize == 'Y'
|
20
23
|
if @addNewRelic
|
21
24
|
@newRelicKey = ask("New relic key:")
|
@@ -88,7 +91,7 @@ module Capun
|
|
88
91
|
def add_jenkins
|
89
92
|
if @addJenkins
|
90
93
|
copy_file "jenkins.config.xml.erb", "config/deploy/jenkins.config.xml.erb"
|
91
|
-
append_to_file "config/deploy/#{singular_name}.rb", "\nset :addJenkins, true"
|
94
|
+
append_to_file "config/deploy/#{singular_name}.rb", "\nset :addJenkins, true\nset :jenkinsToken, \"#{@jenkinsToken}\""
|
92
95
|
end
|
93
96
|
end
|
94
97
|
|
@@ -45,7 +45,7 @@
|
|
45
45
|
<disabled>false</disabled>
|
46
46
|
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
47
47
|
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
48
|
-
<authToken><%=
|
48
|
+
<authToken><%= fetch(:jenkinsToken) %></authToken>
|
49
49
|
<triggers/>
|
50
50
|
<concurrentBuild>false</concurrentBuild>
|
51
51
|
<builders>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Zamylin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -161,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
161
|
version: '0'
|
162
162
|
requirements: []
|
163
163
|
rubyforge_project:
|
164
|
-
rubygems_version: 2.
|
164
|
+
rubygems_version: 2.5.1
|
165
165
|
signing_key:
|
166
166
|
specification_version: 4
|
167
167
|
summary: Opinionated Rails deployment solution with CAPistrano, Unicorn and Nginx.
|