pushwagner 0.0.1.12 → 0.0.2.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
  SHA1:
3
- metadata.gz: 467839b2fe9c8143c2ef51679c3404ba6f2c1d44
4
- data.tar.gz: e7a0cd2c8c061beb4d2d32432826b40cf1476b74
3
+ metadata.gz: a3cd6aa92ef952f06c9a2ace4e43c1939c2e5848
4
+ data.tar.gz: 1455fb2fe3253425399657ac7e04e53fd81661e6
5
5
  SHA512:
6
- metadata.gz: 7ba20f9b4fb588d9155081f26fc5b58f872118f8421f9c40b629daf948cb7884f3dbcb636e13d08a5d67c885b505a99182cadac181b8435bb19d3147469a7c37
7
- data.tar.gz: e308ce447d7bb1b37ac39559b3195de076c76834b61a8361d862d8c59ecfd058969e8e17bb4257a53ba4d84ff2bd887afcf924dbeaa97c2dc3af7609191befe4
6
+ metadata.gz: ed9a2ccec1c3b971ced7e61d974f168b63426e21be4210fd2b9fb277627e4229d07dca6ad29326431aa73802bee30cd800afeebaad937e0b7700d4e2908005a3
7
+ data.tar.gz: 3cd1483fa3ab8930ce90820ef1d7c646aa992d5aae06768ab26b3519dc8fb25ed69149f5c1ba337744840c8a029f678e375dea2f546d67ed039fc6510b0a8847
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pushwagner (0.0.1.10)
4
+ pushwagner (0.0.1.12)
5
5
  colorize (~> 0.7)
6
6
  net-scp (~> 1.2, >= 1.2.1)
7
7
  net-ssh (~> 2.9, >= 2.9.1)
data/README.md CHANGED
@@ -2,7 +2,95 @@
2
2
 
3
3
  [X] Release early, [ ] Release often
4
4
 
5
- Build & deploy:
5
+ ## Document config
6
+
7
+ Pushwagner searches for a config in: `./deploy.yml`, `./.pw.yml`, and `./config/deploy.yml`.
8
+
9
+ Pushwagner is currently extremely opinionated to my usual practises.
10
+
11
+ ### Minimal configuration
12
+
13
+ ````yaml
14
+ # Must set a default path for file uploads
15
+ path_prefix: /var/apps
16
+
17
+ # Must specify a default environment.
18
+ environments:
19
+ default:
20
+ hosts: [test.example.com]
21
+ ````
22
+
23
+ ### Maven (M2) repo integration
24
+
25
+ ````yaml
26
+ # required
27
+ path_prefix: /var/apps
28
+
29
+ maven:
30
+ repositories:
31
+ releases: http://repo.example.com/nexus/content/repositories/releases
32
+ snapshots: http://repo.example.com/nexus/content/repositories/snapshots
33
+ artifacts:
34
+ # creates /var/apps/foo.jar by default (assumes foo-webapp is a jar for now)
35
+ foo:
36
+ group_id: com.example
37
+ artifact_id: foo-webapp
38
+ version: 1.0-SNAPSHOT
39
+ ````
40
+
41
+ ### Static file uploads
42
+
43
+ ````yaml
44
+ path_prefix: /var/apps
45
+
46
+ static:
47
+ /var/log/foo:
48
+ - app.log
49
+ static:
50
+ - file.txt
51
+ - folder/
52
+ /usr/lib/foo:
53
+ # Globbing support
54
+ - src/*{[!.git/]*}
55
+ ````
56
+
57
+ ### Hooks
58
+
59
+ before & after, both local & remote.
60
+
61
+ Sudo support, automatically prompts for passwd, or use: `env PUSHWAGNER_SUDO=sudopasswd`.
62
+
63
+ ````yaml
64
+ hooks:
65
+ local:
66
+ before:
67
+ - mvn package
68
+ after:
69
+ - mvn test -Pintegrationtests
70
+ remote:
71
+ before:
72
+ - /usr/sbin/service foo stop
73
+ after:
74
+ - /usr/sbin/service foo start
75
+ ````
76
+
77
+ ### Environments
78
+
79
+ ````yaml
80
+ environments:
81
+ test: &test
82
+ hosts: [test.example.com]
83
+ user: testuser
84
+ production: &production
85
+ hosts: [production.example.com]
86
+ user: www-data
87
+ default:
88
+ <<: *test
89
+ ````
90
+
91
+
92
+ ## Build & deploy:
93
+
6
94
  bump lib/pushwagner/version.rb
7
95
  gem build pushwagner.gemspec
8
96
  gem push pushwagner-x.x.x.x.gem
@@ -16,10 +16,16 @@ module Pushwagner
16
16
  Net::SCP.start(host, environment.user) do |scp|
17
17
  dest = name.start_with?('/') ? name : "#{environment.path_prefix}/#{name}/"
18
18
  Pushwagner.begin_info "Uploading files to #{host}:#{dest}"
19
-
20
19
  files.each do |f|
21
- if File.exists?(f)
22
- scp.upload!(f, dest, :recursive => File.directory?(f))
20
+ # Define globbing for strings containing an asterisk: '*'
21
+ if f.include?('*')
22
+ puts
23
+ Dir.glob(f).each do |g|
24
+ puts "Uploading #{g} #{'(dir)' if File.directory?(g)} to #{dest}"
25
+ scp.upload!(g, dest, recursive: File.directory?(g))
26
+ end
27
+ elsif File.exists?(f)
28
+ scp.upload!(f, dest, recursive: File.directory?(f))
23
29
  else
24
30
  puts
25
31
  Pushwagner.warning "Local file #{f} does not exist"
@@ -1,3 +1,3 @@
1
1
  module Pushwagner
2
- VERSION = "0.0.1.12"
2
+ VERSION = "0.0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pushwagner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.12
4
+ version: 0.0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ole Christian Rynning
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-09 00:00:00.000000000 Z
11
+ date: 2015-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh