pups 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +69 -27
  3. data/lib/pups/version.rb +1 -1
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 055f645c7b240abd8d9d8206029043d1097611c8
4
- data.tar.gz: 9a0c6803b35b3813058ed89c33f937a959dc9fcb
3
+ metadata.gz: cf30e6638af5d5e6618c872c48c916485a8d75f2
4
+ data.tar.gz: 28da8c64dc283ad29a17cfd02cdb92703c91e296
5
5
  SHA512:
6
- metadata.gz: 2b64563d45db0ec09bb16465e09d81ca4ef39ac92dee8c1b6dd894a24ea4eda5ecc08e6890391e57e3653365f29a39fdcf17399ee383b7bcb9e7e5978ec44b52
7
- data.tar.gz: 0069a7d13b2070240fc23b17befc9dc2a34d1a51c6e7573b575acf892d22251fbf1bd4c44a94820cc86c3d1dbdb5999e0b048fec6dc528a2ce44f0a81d62f9f7
6
+ metadata.gz: b6f37ce6dff5423dcae7b9e92816d6618693d6bb9fdd4e8af70e6e052f6ef31bc4c8397920b183ff985b1a4b0ee42150c812f0a4f5a48c922f9cc818b1ff885c
7
+ data.tar.gz: b3bdbd36b7a2cb327c27f7fc691296ded3a9e63044665939845b0165727259eee49a5664ea5de4674c68ca1f9024bdb16ce7b686397e51522b7eac1d83900a9e
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # pups
2
2
 
3
- Simple yaml based bootstrapper
3
+ Simple YAML--based bootstrapper
4
4
 
5
5
  ## Installation
6
6
 
@@ -28,55 +28,70 @@ params:
28
28
  hello: hello world
29
29
 
30
30
  run:
31
- exec: /bin/bash -c 'echo $hello >>> hello'
31
+ - exec: /bin/bash -c 'echo $hello >>> hello'
32
32
  ```
33
33
 
34
- Running: `pups somefile.yaml` will execute the shell script resulting in a file called "hello" with the "hello world" contents
34
+ Running: `pups somefile.yaml` will execute the shell script resulting in a file called "hello" with the contents "hello world".
35
35
 
36
- ### Features:
36
+ ### Features
37
37
 
38
- ####Execution
38
+ #### Environment Variables
39
+
40
+ By default, pups automatically imports your environment variables and includes them as params.
41
+
42
+ ```
43
+ # In bash
44
+ export SECRET_KEY="secret value"
45
+
46
+ # In somefile.yaml
47
+ run:
48
+ - exec: echo "$SECRET_KEY"
49
+ ```
50
+
51
+ Running the above code with pups will produce `secret value`.
52
+
53
+ #### Execution
39
54
 
40
55
  Run multiple commands in one path:
41
56
 
42
57
  ```
43
58
  run:
44
- exec:
45
- cd: some/path
46
- cmd:
47
- - echo 1
48
- - echo 2
59
+ - exec:
60
+ cd: some/path
61
+ cmd:
62
+ - echo 1
63
+ - echo 2
49
64
  ```
50
65
 
51
66
  Run commands in the background (for services etc)
52
67
 
53
68
  ```
54
69
  run:
55
- exec:
56
- cmd: /usr/bin/sshd
57
- background: true
58
- ```
70
+ - exec:
71
+ cmd: /usr/bin/sshd
72
+ background: true
73
+ ```
59
74
 
60
75
  Suppress exceptions on certain commands
61
76
 
62
77
  ```
63
78
  run:
64
- exec:
65
- cmd: /test
66
- raise_on_faile: false
79
+ - exec:
80
+ cmd: /test
81
+ raise_on_fail: false
67
82
  ```
68
83
 
69
- ####Replacements:
84
+ #### Replacements:
70
85
 
71
86
  ```
72
87
  run:
73
- replace:
74
- filename: "/etc/redis/redis.conf"
75
- from: /^pidfile.*$/
76
- to: ""
88
+ - replace:
89
+ filename: "/etc/redis/redis.conf"
90
+ from: /^pidfile.*$/
91
+ to: ""
77
92
  ```
78
93
 
79
- Will substitued the regex with blank, removing the pidfile line
94
+ Will substitute the regex with blank, removing the pidfile line
80
95
 
81
96
  ```
82
97
  run:
@@ -88,9 +103,34 @@ run:
88
103
  }"
89
104
  ```
90
105
 
91
- Multiline replace using regex
106
+ Additional params:
92
107
 
93
- ####Merge yaml files:
108
+ Global replace (as opposed to first match)
109
+ ```
110
+ global: true
111
+ ```
112
+
113
+ #### Hooks
114
+
115
+ Execute commands before and after a specific command by defining a hook.
116
+
117
+ ```
118
+ run
119
+ - exec:
120
+ hook: hello
121
+ cmd: echo 'Hello'
122
+
123
+ hooks:
124
+ before_hello:
125
+ - exec:
126
+ cmd: echo 'Starting...'
127
+
128
+ after_hello:
129
+ - exec:
130
+ cmd: echo 'World'
131
+ ```
132
+
133
+ #### Merge yaml files
94
134
 
95
135
  ```
96
136
  home: /var/www/my_app
@@ -105,9 +145,11 @@ run:
105
145
 
106
146
  ```
107
147
 
108
- Will merge the yaml file with the inline contents
148
+ Will merge the yaml file with the inline contents.
149
+
150
+ #### A common environment
109
151
 
110
- ####A common environment
152
+ This is implemented in discourse_docker's launcher, not in pups - therefore it does not work in standalone pups.
111
153
 
112
154
  ```
113
155
  env:
data/lib/pups/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pups
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pups
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-09 00:00:00.000000000 Z
11
+ date: 2016-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
132
  version: '0'
133
133
  requirements: []
134
134
  rubyforge_project:
135
- rubygems_version: 2.2.2
135
+ rubygems_version: 2.5.1
136
136
  signing_key:
137
137
  specification_version: 4
138
138
  summary: Process orchestrator