bard 0.59.2 → 0.60.0

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
  SHA256:
3
- metadata.gz: be03f18048d42fca18c08b2e4acfc1ec0abc689cc3308e3672774d67098556c2
4
- data.tar.gz: ebfe954ff476c1fd5f1a2120f3be08ce0cdab036bb49584921bd2b43d14bc6c4
3
+ metadata.gz: 3c445b041aef13bee1cdf19f908b3466b0929c293e22203e8ed283e941466c58
4
+ data.tar.gz: 023d509790ce071eeaf444913491d68f804a6be8c537f3ffc6fb86f3e28122fe
5
5
  SHA512:
6
- metadata.gz: 156f27088ee94fef48ee33c054fdf7a14eadf0875eb3752b661a0cc12b60bb56f655d124799e21566b4d8324bc5deb362ba2fd5991c6070821431e54925987f4
7
- data.tar.gz: dfaea284d495faa359018c0fbacf194d03bd77491c4d4ea21372fca3aadaec0fe6869b7f80fde8f1ada60ef2660b76b378137358892c875a27705f782d4a39d4
6
+ metadata.gz: 0620563e94221dad45f3858c54c1ae24ecd5e2bc58ef19f54b45a66f323b8aff6fad42a1283192e2594701badbfa0687a7859df89f5d61ee04aa8737996020ca
7
+ data.tar.gz: d431dff261d6fe7ee217e414e61f5534a20d4aaa8bbab7bddd14d263a371f4a7a916c91681ebc3fa0e7aaee4e8b5df79bce1b8193a18b603e1e7c8d57a9fd9a1
data/lib/bard/ci.rb CHANGED
@@ -21,30 +21,32 @@ class Bard::CLI < Thor
21
21
  extend Forwardable
22
22
  delegate [:run, :exists?, :console, :last_response, :status] => :runner
23
23
 
24
+ def local?
25
+ @local
26
+ end
27
+
28
+ def github_actions?
29
+ File.exist?(".github/workflows/ci.yml")
30
+ end
31
+
32
+ def jenkins?
33
+ !local? && !github_actions?
34
+ end
35
+
24
36
  private
25
37
 
26
38
  def choose_runner_class
27
39
  if local?
28
40
  require_relative "./ci/local"
29
41
  Local
30
- else
31
- if github_actions?
32
- require_relative "./ci/github_actions"
33
- GithubActions
34
- else
35
- require_relative "./ci/jenkins"
36
- Jenkins
37
- end
42
+ elsif github_actions?
43
+ require_relative "./ci/github_actions"
44
+ GithubActions
45
+ elsif jenkins?
46
+ require_relative "./ci/jenkins"
47
+ Jenkins
38
48
  end
39
49
  end
40
-
41
- def local?
42
- @local
43
- end
44
-
45
- def github_actions?
46
- File.exist?(".github/workflows/ci.yml")
47
- end
48
50
  end
49
51
  end
50
52
 
data/lib/bard/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Bard
2
- VERSION = "0.59.2"
2
+ VERSION = "0.60.0"
3
3
  end
4
4
 
data/lib/bard.rb CHANGED
@@ -8,6 +8,8 @@ require "bard/data"
8
8
  require "bard/config"
9
9
 
10
10
  class Bard::CLI < Thor
11
+ include Thor::Actions
12
+
11
13
  def initialize(*args, **kwargs, &block)
12
14
  super
13
15
  @config = Config.new(project_name, "bard.rb")
@@ -111,7 +113,7 @@ class Bard::CLI < Thor
111
113
  if success
112
114
  puts
113
115
  puts "Continuous integration: success!"
114
- if !options["local-ci"] && File.exist?("coverage")
116
+ if ci.jenkins? && File.exist?("coverage")
115
117
  puts "Downloading test coverage from CI..."
116
118
  download_ci_test_coverage
117
119
  end
@@ -171,6 +173,37 @@ class Bard::CLI < Thor
171
173
  system "cp -R #{github_files_path} ./"
172
174
  end
173
175
 
176
+ desc "setup", "installs app in nginx"
177
+ def setup
178
+ path = "/etc/nginx/sites-available/#{project_name}"
179
+ dest_path = path.sub("sites-available", "sites-enabled")
180
+ server_name = "#{project_name}.localhost"
181
+
182
+ create_file path, <<~NGINX
183
+ server {
184
+ listen 80;
185
+ server_name #{server_name};
186
+
187
+ root #{Dir.pwd}/public;
188
+ passenger_enabled on;
189
+
190
+ location ~* \\.(ico|css|js|gif|jp?g|png|webp) {
191
+ access_log off;
192
+ if ($request_filename ~ "-[0-9a-f]{32}\\.") {
193
+ expires max;
194
+ add_header Cache-Control public;
195
+ }
196
+ }
197
+ gzip_static on;
198
+ }
199
+ NGINX
200
+
201
+ FileUtils.ln_sf(path, dest_path) if !File.exist?(dest_path)
202
+ run "service nginx restart"
203
+ rescue Errno::EACCES
204
+ raise InvocationError.new("please re-run with sudo")
205
+ end
206
+
174
207
  desc "ping [SERVER=production]", "hits the server over http to verify that its up."
175
208
  def ping server=:production
176
209
  server = @config.servers[server.to_sym]
@@ -209,5 +242,7 @@ class Bard::CLI < Thor
209
242
  def vim branch="master"
210
243
  exec "vim -p `git diff #{branch} --name-only | grep -v sass$ | tac`"
211
244
  end
245
+
246
+ def self.exit_on_failure? = true
212
247
  end
213
248
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.59.2
4
+ version: 0.60.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-05 00:00:00.000000000 Z
11
+ date: 2024-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
180
  - !ruby/object:Gem::Version
181
181
  version: '0'
182
182
  requirements: []
183
- rubygems_version: 3.5.3
183
+ rubygems_version: 3.5.6
184
184
  signing_key:
185
185
  specification_version: 4
186
186
  summary: CLI to automate common development tasks.