bard 0.59.3 → 0.61.0

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: 38956ca84edead7bc46197a53aff83f1684eae930e8fed10d230091b4ec3af50
4
- data.tar.gz: '095c71e86c3eb768809b37702dc5e45639ca8697677dfbb3941d1a7cb6e28fbe'
3
+ metadata.gz: bdddc541607bbf0fb29fbdd281e8065785f1a5c381fb4494a62947cb2c21d0e7
4
+ data.tar.gz: cc3e28b16f6807f42140638e3bce5dbb0a5404500250bd520cb52ccec88eb6d0
5
5
  SHA512:
6
- metadata.gz: b3f6f485712f5a5cc6343fcadfd989041da32f303d87291af7b093f8d5a6238ec0e71ae117e6993a635222abcfe2e2b1b1261d948bd0a4fed1905cf6649369ca
7
- data.tar.gz: 3002ddf4ce77835ef490f623090ed3ce249d90825f41f45428d49f0cabad1b51ecc5815d86ce84c857950dfdc641522ff7d0814c43d6a2bb2394f5de30ec780c
6
+ metadata.gz: 5d932199974ba63b0c2c204afaa94597178ef54fbfa3ef9730064d54014ca59886332f54d8a6199a1fe6fc815f49f6b3be34fa2b3240aa8f5a3926165964652b
7
+ data.tar.gz: fb837322767db80c5fcfd41d9e365aedc90d4d72533fc1daba6949d4db8f3773a641a9a2860e7d8190369d2565ab73760ece62fa31488ff4669b6ac9b888d186
@@ -1,12 +1,17 @@
1
1
  name: ci
2
2
  on:
3
- pull_request:
3
+ pull_request_target:
4
4
  workflow_dispatch:
5
5
  inputs:
6
6
  git-ref:
7
7
  description: Git Ref
8
8
  default: master
9
9
  required: true
10
+
11
+ permissions:
12
+ contents: write
13
+ pull-requests: write
14
+
10
15
  jobs:
11
16
  test:
12
17
  runs-on: ubuntu-20.04-16core
@@ -31,3 +36,29 @@ jobs:
31
36
  - name: Run tests
32
37
  run: bin/ci
33
38
 
39
+ autodeploy-dependabot-prs:
40
+ needs: test
41
+ runs-on: ubuntu-20.04
42
+ if: github.actor == 'dependabot[bot]'
43
+ steps:
44
+ - name: Merge Dependabot PR
45
+ run: gh pr merge --auto --rebase "$PR_URL"
46
+ env:
47
+ PR_URL: ${{github.event.pull_request.html_url}}
48
+ GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
49
+ - uses: actions/checkout@v3
50
+ - uses: ruby/setup-ruby@v1
51
+ with:
52
+ bundler-cache: true
53
+ - name: Install SSH key
54
+ uses: shimataro/ssh-key-action@v2
55
+ with:
56
+ key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}
57
+ known_hosts: unnecessary
58
+ config: |
59
+ Host *
60
+ StrictHostKeyChecking no
61
+ UserKnownHostsFile=/dev/null
62
+ - name: deploy
63
+ run: bundle exec bard deploy --skip-ci
64
+
data/lib/bard/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Bard
2
- VERSION = "0.59.3"
2
+ VERSION = "0.61.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")
@@ -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.3
4
+ version: 0.61.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-04-01 00:00:00.000000000 Z
11
+ date: 2024-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -140,7 +140,6 @@ files:
140
140
  - features/support/io.rb
141
141
  - install_files/.github/workflows/cache-ci.yml
142
142
  - install_files/.github/workflows/ci.yml
143
- - install_files/.github/workflows/deploy.yml
144
143
  - install_files/apt_dependencies.rb
145
144
  - install_files/ci
146
145
  - install_files/setup
@@ -1,26 +0,0 @@
1
- name: deploy
2
- on:
3
- pull_request:
4
- types:
5
- - closed
6
- jobs:
7
- deploy:
8
- if: github.event.pull_request.merged == true
9
- runs-on: ubuntu-20.04
10
- steps:
11
- - uses: actions/checkout@v3
12
- - uses: ruby/setup-ruby@v1
13
- with:
14
- bundler-cache: true
15
- - name: Install SSH key
16
- uses: shimataro/ssh-key-action@v2
17
- with:
18
- key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}
19
- known_hosts: unnecessary
20
- config: |
21
- Host *
22
- StrictHostKeyChecking no
23
- UserKnownHostsFile=/dev/null
24
- - name: deploy
25
- run: bundle exec bard deploy --skip-ci
26
-