bard 1.4.0 → 1.4.1

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: cb512a4a019bd8b6c275c56d5f18107756dbd9f9792747e96b13435c5fb67257
4
- data.tar.gz: 54f9674d14d7ec28ec98024fdde5c33b3869808e144beb9c49f19b6ac8c0f526
3
+ metadata.gz: b61ad7f978453da17070fecbb92f64e0fc3311f3c8b530d7cb89227f6a72d286
4
+ data.tar.gz: f0961592b8234b9c71929cfb5f34b9cc9edbf4f75485331bdf25a6a27e620e44
5
5
  SHA512:
6
- metadata.gz: 4df00ef514149aa70765c4998c62c5bbbbe21e4e40990979fe7fcf99005ee20b362ec6f8bc2dc78112afd8b0e25a7e5874d2761f14ba89488da0ced2a2c87c89
7
- data.tar.gz: 1c32f9fd761e8723798d0d87b2b748a0d5befc716555907561fc0924b921fe8d1ca280f3ee48377c47e35129b6fbd9eb29b7262c9e13c1923ac72ef6b478dce3
6
+ metadata.gz: bb9fa351d2b084dc624909e0691aa0ad698c182bf5d0417c3e5731f63bc9ac2aaa90b23be87ba3c894abb74a4b16baf5a638124789eb3eefd8e2087ba6b71257
7
+ data.tar.gz: 902e8f5be5ae6c1c47cbf34c771fe77c1e3dc298f345983732c6b7cd74eb7293c9d6c325cf2e90814532a85bbaa22b9825c416e507ee40aec88c9068e1bfd328
@@ -30,6 +30,14 @@ jobs:
30
30
  uses: ruby/setup-ruby@v1
31
31
  with:
32
32
  bundler-cache: true
33
+ - name: Set up apt packages
34
+ run: |
35
+ sudo rm -f /var/lib/man-db/auto-update
36
+ echo "APT_PACKAGES=$(paste -sd " " Aptfile)" >> $GITHUB_ENV
37
+ - name: Apt packages
38
+ uses: awalsh128/cache-apt-pkgs-action@latest
39
+ with:
40
+ packages: ${{ env.APT_PACKAGES }}
33
41
  - name: Setup
34
42
  run: bin/setup
35
43
  - name: Run tests
@@ -3,6 +3,7 @@ module AptDependencies
3
3
 
4
4
  def self.ensure!
5
5
  return "true" if deps_to_install.none?
6
+ return "true" if ENV["APT_PACKAGES"] # already installed via github actions
6
7
  if sudo_password_required? && ENV["RAILS_ENV"] != "development"
7
8
  $stderr.puts "sudo requires password! cannot install #{deps_to_install.join(' ')}"
8
9
  exit 1
data/lib/bard/cli/new.rb CHANGED
@@ -52,6 +52,7 @@ class Bard::CLI::New < Bard::CLI::Command
52
52
  BASH
53
53
  api.add_master_key File.read("../#{project_name}/config/master.key")
54
54
  api.add_master_branch_protection
55
+ api.patch(nil, allow_auto_merge: true)
55
56
  end
56
57
 
57
58
  def stage
@@ -67,6 +67,7 @@ file "Gemfile", <<~RUBY
67
67
 
68
68
  group :development, :test do
69
69
  gem "debug", require: "debug/prelude"
70
+ gem "parallel_tests", "~>3.9.0" # 3.10 pegs CPU
70
71
  gem "brakeman", require: false
71
72
  gem "rubocop-rails-omakase", require: false
72
73
  end
@@ -23,10 +23,11 @@ class Bard::CLI::Provision < Bard::CLI::Command
23
23
  desc "provision [ssh_url] --steps=all", "takes an optional ssh url to a raw ubuntu 22.04 install, and readies it in the shape of :production"
24
24
  option :steps, type: :array, default: STEPS
25
25
  def provision ssh_url=config[:production].ssh
26
+ # unfreeze the string for later mutation
27
+ ssh_url = ssh_url.dup
26
28
  options[:steps].each do |step|
27
29
  require "bard/provision/#{step.downcase}"
28
- # dup unfreezes the string for later mutation
29
- Bard::Provision.const_get(step).call(config, ssh_url.dup)
30
+ Bard::Provision.const_get(step).call(config, ssh_url)
30
31
  end
31
32
  end
32
33
  end
data/lib/bard/github.rb CHANGED
@@ -28,6 +28,14 @@ module Bard
28
28
  end
29
29
  end
30
30
 
31
+ def patch path, params={}
32
+ request(path) do |uri|
33
+ Net::HTTP::Patch.new(uri).tap do |r|
34
+ r.body = JSON.dump(params)
35
+ end
36
+ end
37
+ end
38
+
31
39
  def delete path, params={}
32
40
  request(path) do |uri|
33
41
  Net::HTTP::Delete.new(uri).tap do |r|
@@ -85,7 +93,7 @@ module Bard
85
93
  end
86
94
 
87
95
  def delete_repo
88
- delete("https://api.github.com/repos/botandrosedesign/#{project_name}")
96
+ delete(nil)
89
97
  end
90
98
 
91
99
  private
@@ -101,7 +109,12 @@ module Bard
101
109
  uri = if path =~ /^http/
102
110
  URI(path)
103
111
  else
104
- URI("https://api.github.com/repos/botandrosedesign/#{project_name}/#{path}")
112
+ base = "https://api.github.com/repos/botandrosedesign/#{project_name}"
113
+ if path
114
+ URI.join(base, path)
115
+ else
116
+ URI(base)
117
+ end
105
118
  end
106
119
 
107
120
  req = nil
@@ -8,6 +8,7 @@ class Bard::Provision::MySQL < Bard::Provision
8
8
  provision_server.run! [
9
9
  "sudo apt-get install -y mysql-server",
10
10
  %(sudo mysql -uroot -e "ALTER USER \\"'\\"root\\"'\\"@\\"'\\"localhost\\"'\\" IDENTIFIED WITH mysql_native_password BY \\"'\\"\\"'\\", \\"'\\"root\\"'\\"@\\"'\\"localhost\\"'\\" PASSWORD EXPIRE NEVER; FLUSH PRIVILEGES;"),
11
+ %(mysql -uroot -e "UPDATE mysql.user SET password_lifetime = NULL WHERE user = 'root' AND host = 'localhost';"),
11
12
  ].join("; "), home: true
12
13
  end
13
14
 
@@ -36,7 +36,7 @@ class Bard::Provision::User < Bard::Provision
36
36
  end
37
37
 
38
38
  def ssh_with_user? ssh_uri, user: ssh_uri.user
39
- system "ssh -o ConnectTimeout=2 -p#{ssh_uri.port || 22} #{user}@#{ssh_uri.host} exit >/dev/null 2>&1"
39
+ system "ssh -o ConnectTimeout=2 -p#{ssh_uri.port || 22} #{user}@#{ssh_uri.host} : >/dev/null 2>&1"
40
40
  end
41
41
  end
42
42
 
data/lib/bard/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Bard
2
- VERSION = "1.4.0"
2
+ VERSION = "1.4.1"
3
3
  end
4
4
 
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: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-22 00:00:00.000000000 Z
11
+ date: 2025-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor