mrsk 0.7.0 → 0.7.2

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: de97b438ef507257a74ec7c5143028946072ac152ff631e979f71788786bc2ba
4
- data.tar.gz: 35112851498a8a99452850077ad1845f403d198d49b39fb769a746690c48909b
3
+ metadata.gz: 5d90c03e2bcea1e39e38d773fd79d4154f24ec3297c5e31d0240e23d25adc6af
4
+ data.tar.gz: 68aac28eaef8b0246a4cef80d18da9f37069af8740cde1dd7505ef7bad7df8f1
5
5
  SHA512:
6
- metadata.gz: f35616494c2fcf90fb00f2cfd108492147e76d5eb12b91356a520dd0c5b7974bb6336feb55fa8239df407566144b1b1e069d1981e6aad8c159068e4bb4a91d5d
7
- data.tar.gz: 4e9e55f95b32399c465384351d209bc12709158f39ce05f4ea1b569a3e9f1bd7cb725ce8bd795aa18548230812c0309e0d277392bf942adc62e3a6f436d626d4
6
+ metadata.gz: 1d491ed1430092b12de3e3a4e765f8da11f4a68c62e86b280368a96389829e1fd0b0238ff11f4811f974dc5aee3e166a5cff9cc3e85ce3ad11e34e4d37def484
7
+ data.tar.gz: 6e876c4c838c8ca8bcd28f1aa465d97190f6580bcad9942d2c6149346163c1289df18903cdb129c34715a06927d5945dcd988751ec2da397cf6c313781eb0911
data/README.md CHANGED
@@ -348,7 +348,7 @@ If you need separate env variables for different destinations, you can set them
348
348
 
349
349
  ### Using audit broadcasts
350
350
 
351
- If you'd like to broadcast audits of deploys, rollbacks, etc to a chatroom or elsewhere, you can configure the `audit_broadcast_cmd` setting with the path to a bin file that reads the audit line from STDIN, and then does whatever with it:
351
+ If you'd like to broadcast audits of deploys, rollbacks, etc to a chatroom or elsewhere, you can configure the `audit_broadcast_cmd` setting with the path to a bin file that will be passed the audit line as the first argument:
352
352
 
353
353
  ```yaml
354
354
  audit_broadcast_cmd:
@@ -359,14 +359,13 @@ The broadcast command could look something like:
359
359
 
360
360
  ```bash
361
361
  #!/usr/bin/env bash
362
- read
363
- curl -q -d content="[My app] ${REPLY}" https://3.basecamp.com/XXXXX/integrations/XXXXX/buckets/XXXXX/chats/XXXXX/lines
362
+ curl -q -d content="[My App] ${1}" https://3.basecamp.com/XXXXX/integrations/XXXXX/buckets/XXXXX/chats/XXXXX/lines
364
363
  ```
365
364
 
366
365
  That'll post a line like follows to a preconfigured chatbot in Basecamp:
367
366
 
368
367
  ```
369
- [My App] [2023-02-18 11:29:52] [dhh] Rolled back to version d264c4e92470ad1bd18590f04466787262f605de
368
+ [My App] [dhh] Rolled back to version d264c4e92470ad1bd18590f04466787262f605de
370
369
  ```
371
370
 
372
371
  ### Using custom healthcheck path or port
@@ -4,16 +4,14 @@ class Mrsk::Commands::Auditor < Mrsk::Commands::Base
4
4
  # Runs remotely
5
5
  def record(line)
6
6
  append \
7
- [ :echo, tagged_line(line) ],
7
+ [ :echo, tagged_record_line(line) ],
8
8
  audit_log_file
9
9
  end
10
10
 
11
11
  # Runs locally
12
12
  def broadcast(line)
13
13
  if broadcast_cmd = config.audit_broadcast_cmd
14
- pipe \
15
- [ :echo, tagged_line(line) ],
16
- broadcast_cmd
14
+ [ broadcast_cmd, tagged_broadcast_line(line) ]
17
15
  end
18
16
  end
19
17
 
@@ -26,19 +24,19 @@ class Mrsk::Commands::Auditor < Mrsk::Commands::Base
26
24
  "mrsk-#{config.service}-audit.log"
27
25
  end
28
26
 
29
- def tagged_line(line)
30
- "'#{tags} #{line}'"
27
+ def tagged_record_line(line)
28
+ "'#{recorded_at_tag} #{performer_tag} #{line}'"
31
29
  end
32
30
 
33
- def tags
34
- "[#{recorded_at}] [#{performer}]"
31
+ def tagged_broadcast_line(line)
32
+ "'#{performer_tag} #{line}'"
35
33
  end
36
34
 
37
- def performer
38
- @performer ||= `whoami`.strip
35
+ def performer_tag
36
+ "[#{`whoami`.strip}]"
39
37
  end
40
38
 
41
- def recorded_at
42
- Time.now.to_fs(:db)
39
+ def recorded_at_tag
40
+ "[#{Time.now.to_fs(:db)}]"
43
41
  end
44
42
  end
data/lib/mrsk/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mrsk
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mrsk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson