pushwagner 0.0.1.12 → 0.0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +89 -1
- data/lib/pushwagner/static.rb +9 -3
- data/lib/pushwagner/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3cd6aa92ef952f06c9a2ace4e43c1939c2e5848
|
4
|
+
data.tar.gz: 1455fb2fe3253425399657ac7e04e53fd81661e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed9a2ccec1c3b971ced7e61d974f168b63426e21be4210fd2b9fb277627e4229d07dca6ad29326431aa73802bee30cd800afeebaad937e0b7700d4e2908005a3
|
7
|
+
data.tar.gz: 3cd1483fa3ab8930ce90820ef1d7c646aa992d5aae06768ab26b3519dc8fb25ed69149f5c1ba337744840c8a029f678e375dea2f546d67ed039fc6510b0a8847
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,95 @@
|
|
2
2
|
|
3
3
|
[X] Release early, [ ] Release often
|
4
4
|
|
5
|
-
|
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
|
data/lib/pushwagner/static.rb
CHANGED
@@ -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
|
-
|
22
|
-
|
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"
|
data/lib/pushwagner/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|