bard 1.4.0 → 1.4.1
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 +4 -4
- data/install_files/.github/workflows/ci.yml +8 -0
- data/install_files/apt_dependencies.rb +1 -0
- data/lib/bard/cli/new.rb +1 -0
- data/lib/bard/cli/new_rails_template.rb +1 -0
- data/lib/bard/cli/provision.rb +3 -2
- data/lib/bard/github.rb +15 -2
- data/lib/bard/provision/mysql.rb +1 -0
- data/lib/bard/provision/user.rb +1 -1
- data/lib/bard/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b61ad7f978453da17070fecbb92f64e0fc3311f3c8b530d7cb89227f6a72d286
|
4
|
+
data.tar.gz: f0961592b8234b9c71929cfb5f34b9cc9edbf4f75485331bdf25a6a27e620e44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
data/lib/bard/cli/provision.rb
CHANGED
@@ -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
|
-
|
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(
|
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
|
-
|
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
|
data/lib/bard/provision/mysql.rb
CHANGED
@@ -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
|
|
data/lib/bard/provision/user.rb
CHANGED
@@ -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}
|
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
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.
|
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-
|
11
|
+
date: 2025-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|