bard 1.3.4 → 1.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa717f489274f4bb6340a42930201281ab1c012d368b9cbdee3263bac15ec62b
4
- data.tar.gz: 010036ea949f34ac503ec179ebbace96f95762b0bdd7e35674a0674b8c2dc924
3
+ metadata.gz: 5053dc8c4726e144736e568b70eaccff71dc0f6dced2d87c9d5dc3e18ded0906
4
+ data.tar.gz: a350973b973785621969f862e981dada65e46a1bacbe7bdabb30c5ab188c1779
5
5
  SHA512:
6
- metadata.gz: 39bce499b49e7d9c33cf9147190a3b4ee986fe383b905d9c31e2fb9dfff79cdb819050943eb50615c230f96c7133e1b4816563afecb8cf0e4f4adc1854f46de6
7
- data.tar.gz: 7765e288e7184d9d124e4a2c8b55aeda92fd6ab35f99c8d35ec3e887ecdb7b60b6009f7726e5095bf21c1accf59d8a862175b6b9110dff46673088ee3b30edc0
6
+ metadata.gz: a87bf99bf8b8374906254753fae5b18a7374d2f51c5e6fe3c3841828807f12b61233dc205a7a9ea11ee9a4f91e5bb0b9ff61395240fc30ef7fd4ef2ce763f8d7
7
+ data.tar.gz: 371d04cb10632a937c7a65a761498df299f06a26a7d7d05e0c6f8cf941fadf5a99581c64e07d235bccc2c029e5ad67fa948dfe0d24c1094094ef5c1824bde5bb
@@ -9,10 +9,11 @@ class Bard::CLI::Command < SimpleDelegator
9
9
 
10
10
  def self.setup cli
11
11
  cli.desc @command, @description
12
-
13
- method = @method # put in local variable so next block can capture it
12
+ # put in local variables so next block can capture it
13
+ command_class = self
14
+ method = @method
14
15
  cli.define_method method do |*args|
15
- command = Bard::CLI::New.new(self)
16
+ command = command_class.new(self)
16
17
  command.send method, *args
17
18
  end
18
19
  end
@@ -40,8 +40,8 @@ module Bard::CLI::Deploy
40
40
  end
41
41
 
42
42
  if options[:clone]
43
- config[to].run! "git clone git@github.com:botandrosedesign/#{project_name}", home: true
44
- invoke :master_key, nil, from: "local", to: to
43
+ config[to].run! "git clone git@github.com:botandrosedesign/#{project_name} #{config[to].path}", home: true
44
+ invoke :master_key, [], from: "local", to: to
45
45
  config[to].run! "bin/setup && bard setup"
46
46
  else
47
47
  if config[to].github_pages
data/lib/bard/cli/new.rb CHANGED
@@ -34,7 +34,7 @@ class Bard::CLI::New < Bard::CLI::Command
34
34
  rvm use --create #{ruby_version}@#{project_name}
35
35
 
36
36
  gem list rails -i || gem install rails --no-document
37
- rails new #{project_name} --skip-git --skip-kamal -m #{template_path}
37
+ rails new #{project_name} --skip-git --skip-kamal --skip-test -m #{template_path}
38
38
  '
39
39
  BASH
40
40
  end
@@ -54,7 +54,7 @@ class Bard::CLI::New < Bard::CLI::Command
54
54
  def stage
55
55
  run! <<~BASH
56
56
  cd ../#{project_name}
57
- bard deploy --provision
57
+ bard deploy --clone
58
58
  BASH
59
59
  end
60
60
 
@@ -2,6 +2,34 @@ ruby_version, project_name = (`rvm current name`.chomp).split("@")
2
2
 
3
3
  file ".ruby-version", ruby_version
4
4
  file ".ruby-gemset", project_name
5
+ file ".gitignore", <<~GITIGNORE
6
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
7
+ #
8
+ # If you find yourself ignoring temporary files generated by your text editor
9
+ # or operating system, you probably want to add a global ignore instead:
10
+ # git config --global core.excludesfile '~/.gitignore_global'
11
+
12
+ # Ignore bundler config.
13
+ /.bundle
14
+
15
+ # Ignore all logfiles and tempfiles.
16
+ /log/*
17
+ /tmp/*
18
+ !/log/.keep
19
+ !/tmp/.keep
20
+
21
+ # Ignore master key for decrypting credentials and more.
22
+ /config/master.key
23
+
24
+ /db/*.sqlite3
25
+ /db/data.*
26
+
27
+ # Ignore Syncthing
28
+ .stfolder/
29
+
30
+ # Thank Apple!
31
+ .DS_Store
32
+ GITIGNORE
5
33
 
6
34
  file "Gemfile", <<~RUBY
7
35
  source "https://rubygems.org"
@@ -24,6 +52,7 @@ file "Gemfile", <<~RUBY
24
52
  gem "solid_cable"
25
53
 
26
54
  gem "image_processing"
55
+ gem "puma"
27
56
 
28
57
  group :development do
29
58
  gem "web-console"
@@ -40,7 +69,6 @@ file "Gemfile", <<~RUBY
40
69
  gem "cuprite-downloads"
41
70
  gem "capybara-screenshot"
42
71
  gem "database_cleaner"
43
- gem "puma"
44
72
  gem "chop"
45
73
  gem "email_spec"
46
74
  gem "timecop"
@@ -49,7 +77,6 @@ file "Gemfile", <<~RUBY
49
77
 
50
78
  group :production do
51
79
  gem "foreman-export-systemd_user"
52
- gem "puma"
53
80
  end
54
81
  RUBY
55
82
 
@@ -1,15 +1,10 @@
1
+ require "bard/cli/command"
1
2
  require "bard/provision"
2
3
 
3
- module Bard::CLI::Provision
4
- def self.included mod
5
- mod.class_eval do
6
-
7
- desc "provision [ssh_url]", "takes an optional ssh url to a raw ubuntu 22.04 install, and readies it in the shape of :production"
8
- def provision ssh_url=config[:production].ssh
9
- Bard::Provision.call(config, ssh_url.dup) # dup unfreezes the string for later mutation
10
- end
11
-
12
- end
4
+ class Bard::CLI::Provision < Bard::CLI::Command
5
+ desc "provision [ssh_url]", "takes an optional ssh url to a raw ubuntu 22.04 install, and readies it in the shape of :production"
6
+ def provision ssh_url=config[:production].ssh
7
+ Bard::Provision.call(config, ssh_url.dup) # dup unfreezes the string for later mutation
13
8
  end
14
9
  end
15
10
 
data/lib/bard/cli.rb CHANGED
@@ -22,7 +22,6 @@ module Bard
22
22
  open: "Open",
23
23
  ssh: "SSH",
24
24
  install: "Install",
25
- provision: "Provision",
26
25
  ping: "Ping",
27
26
  hurt: "Hurt",
28
27
  vim: "Vim",
@@ -32,6 +31,7 @@ module Bard
32
31
  end
33
32
 
34
33
  {
34
+ provision: "Provision",
35
35
  new: "New",
36
36
  }.each do |command, klass|
37
37
  require "bard/cli/#{command}"
@@ -47,16 +47,14 @@ module Bard
47
47
  puts red("!!! ") + "Running command failed: #{yellow(e.message)}"
48
48
  exit 1
49
49
  end
50
- end
51
-
52
- private
53
50
 
54
- def config
55
- @config ||= Bard::Config.new(project_name, path: "bard.rb")
56
- end
51
+ def config
52
+ @config ||= Bard::Config.new(project_name, path: "bard.rb")
53
+ end
57
54
 
58
- def project_name
59
- @project_name ||= File.expand_path(".").split("/").last
55
+ def project_name
56
+ @project_name ||= File.expand_path(".").split("/").last
57
+ end
60
58
  end
61
59
  end
62
60
  end
@@ -5,10 +5,10 @@ class Bard::Provision::AuthorizedKeys < Bard::Provision
5
5
  print "Authorized Keys:"
6
6
 
7
7
  KEYS.each do |search_text, full_key|
8
- provision_server.run! <<~BASH #, quiet: true
9
- file=~/.ssh/authorized_keys
10
- if ! grep -F -q "#{search_text}" $file; then
11
- echo "#{full_key}" >> $file
8
+ file = "~/.ssh/authorized_keys"
9
+ provision_server.run! <<~BASH, home: true
10
+ if ! grep -F -q "#{search_text}" #{file}; then
11
+ echo "#{full_key}" >> #{file}
12
12
  fi
13
13
  BASH
14
14
  end
@@ -0,0 +1,10 @@
1
+ # run bard deploy
2
+
3
+ class Bard::Provision::Deploy < Bard::Provision
4
+ def call
5
+ print "Deploy:"
6
+ config[:local].run! "bard deploy"
7
+ puts " ✓"
8
+ end
9
+ end
10
+
@@ -3,7 +3,7 @@ module Bard
3
3
  def self.call(...) = new(...).call
4
4
 
5
5
  def call
6
- %w[SSH User AuthorizedKeys Apt MySQL Repo MasterKey RVM App Passenger Data HTTP LogRotation].each do |step|
6
+ %w[SSH User AuthorizedKeys Apt MySQL Repo MasterKey RVM App Passenger Data HTTP LogRotation Deploy].each do |step|
7
7
  require "bard/provision/#{step.downcase}"
8
8
  self.class.const_get(step).call(*values)
9
9
  end
data/lib/bard/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Bard
2
- VERSION = "1.3.4"
2
+ VERSION = "1.3.6"
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.3.4
4
+ version: 1.3.6
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-12-31 00:00:00.000000000 Z
11
+ date: 2025-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -167,6 +167,7 @@ files:
167
167
  - lib/bard/provision/apt.rb
168
168
  - lib/bard/provision/authorizedkeys.rb
169
169
  - lib/bard/provision/data.rb
170
+ - lib/bard/provision/deploy.rb
170
171
  - lib/bard/provision/http.rb
171
172
  - lib/bard/provision/logrotation.rb
172
173
  - lib/bard/provision/masterkey.rb