pult 0.0.14 → 0.0.15
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 +4 -4
- data/CHANGELOG.md +18 -0
- data/README.md +116 -41
- data/example/pult.yml +6 -7
- data/lib/pult/api/drawer.rb +2 -1
- data/lib/pult/panel/injector/runner.rb +6 -6
- data/lib/pult/version.rb +1 -1
- data/pult.gemspec +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 308b0fe9ee50de08f18432fac828b5ae189dfed04ca360b7c8b11603cc19c1bc
|
4
|
+
data.tar.gz: 605d8aad93efe084bedeb919c2e4375ca6948a73bd2bfe2b3274ab95351e4a76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c226cd807dc31fa6b21dd95dc225cb4a7139359c7be7bfb510a1e7f89e356f0ea86dfff7fe2ab38f98417ea13ad268fae37536b99173ec2a8ffba267150a40c9
|
7
|
+
data.tar.gz: d5045206075175c80afe8448dd5d6d4462efecc60e80572d0c42340f9271f49ae2539433b9bae2ddd93ccf6a8b1d58c142b64f5f44c46874c0ce2221e56742eb
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [0.0.15] - 2019-15-09
|
8
|
+
### Status
|
9
|
+
- Dev version
|
10
|
+
|
11
|
+
### Updates
|
12
|
+
- Fix `example/pult.yml`
|
13
|
+
- Update and refactoring README.md (add Use cases and other descriptions)
|
14
|
+
- Add summary text in `pult.gemspec` for rubygems.org
|
15
|
+
|
16
|
+
## [0.0.14] - 2019-13-09
|
17
|
+
### Status
|
18
|
+
- Dev version
|
19
|
+
|
20
|
+
### Updates
|
21
|
+
- Fix and new pattern for env vars yml (UPCASED and downcased)
|
22
|
+
- New default port for API server (7070)
|
23
|
+
- Add README Installation, Usage, TODO
|
24
|
+
|
7
25
|
## [0.0.13] - 2019-13-09
|
8
26
|
### Status
|
9
27
|
- Dev version
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Pult
|
2
2
|
|
3
|
-
**
|
3
|
+
**UNDER CUNSTRUCTION!** This is **Dev** version (0.0.*x*)
|
4
4
|
|
5
5
|
Development progress can be reached at [CHANGELOG](./CHANGELOG.md)
|
6
6
|
|
@@ -8,9 +8,9 @@ Ruby *>= 2.3.0* require
|
|
8
8
|
|
9
9
|
# What is Pult?
|
10
10
|
|
11
|
-
|
11
|
+
Universal API service for manage your appications and system tasks via Ruby or HTTP.
|
12
12
|
|
13
|
-
|
13
|
+
You can manage your apps **localy** or **remotely**.
|
14
14
|
|
15
15
|
# Installation
|
16
16
|
|
@@ -20,19 +20,33 @@ gem install pult
|
|
20
20
|
|
21
21
|
# Usage
|
22
22
|
|
23
|
-
|
23
|
+
Proceed from the fact, that we have:
|
24
|
+
- Single Linux host (virtual or bare) with ruby installed
|
25
|
+
- You want to run your applications on it and manage them
|
26
|
+
- You want to manage some system tasks too
|
24
27
|
|
25
|
-
|
28
|
+
Talking about usage Pult, first of all we need to talk about use cases..
|
26
29
|
|
27
|
-
|
30
|
+
## Use Cases
|
31
|
+
|
32
|
+
There are to types of it:
|
33
|
+
1. Manage **one** application
|
34
|
+
2. Manage **many** applications
|
35
|
+
|
36
|
+
Manage many applications is the feature of Pult. But to understand the concept and use technique, we start with first item.
|
37
|
+
|
38
|
+
## 1. Manage ONE application
|
39
|
+
|
40
|
+
### 1.1. Configure app actions via pult.yml
|
41
|
+
|
42
|
+
Put `pult.yml` anywere into your app folder, some kind of `<app>/pult.yml` or `<app>/config/pult.yml`, and create any actions you need for manage your app:
|
28
43
|
```yaml
|
29
|
-
#
|
30
|
-
|
31
|
-
#
|
44
|
+
# actions is a simple linux shell commands
|
45
|
+
|
32
46
|
appname:
|
33
|
-
test: '
|
47
|
+
test: 'sleep 20 && echo 123'
|
34
48
|
|
35
|
-
#
|
49
|
+
# can combine actions of the same level
|
36
50
|
up: [pull, prepare, start]
|
37
51
|
restart: [stop, start]
|
38
52
|
|
@@ -40,52 +54,113 @@ appname:
|
|
40
54
|
|
41
55
|
prepare: rails assets:precompile
|
42
56
|
|
43
|
-
# if var is upcase, it will be required in API as a param
|
57
|
+
# if var is upcase, it will be required in API as a param
|
44
58
|
start: rails s -e production -p $PORT
|
45
59
|
|
46
|
-
# if var is downcase, it will be not required, just local stuff
|
60
|
+
# if var is downcase, it will be not required, just local stuff
|
47
61
|
stop: f=tmp/pids/server.pid; if [ -f "$f" ]; then rm $f; fi
|
48
62
|
|
49
|
-
#
|
63
|
+
# can grouping actions in sublevels
|
50
64
|
log:
|
51
|
-
clean: >log/production.log
|
65
|
+
clean: '>log/production.log'
|
52
66
|
view: cat log/production.log
|
53
67
|
```
|
54
68
|
|
55
|
-
|
69
|
+
### 1.2. Understanding what Pult gives you after that
|
70
|
+
|
71
|
+
Pult provides a bunch universal actions, based on your app actions that you configured in `pult.yml` by adding some special *postfixes* to them (like `_job`, `_out` and etc..)
|
72
|
+
|
73
|
+
List of this new Pult API actions, that do some things:
|
74
|
+
- `<action>` to get source code of action or run it
|
75
|
+
- `<action>_job` to run action in a backround
|
76
|
+
- `<action>_out` to get STDOUT of action
|
77
|
+
- `<action>_err` to get STDERR of action
|
78
|
+
- `<action>_suc` to get STDERR of action
|
79
|
+
|
80
|
+
### 1.2. Start Pult HTTP server and manage your app via API
|
81
|
+
|
82
|
+
Main principle of interact with API is:
|
83
|
+
- `GET` method is used for **view** something
|
84
|
+
- `POST` method is used for **run** something
|
85
|
+
|
86
|
+
Lets start it.
|
87
|
+
|
88
|
+
**In your app folder**, type:
|
56
89
|
```bash
|
57
90
|
pult server
|
58
91
|
```
|
59
92
|
|
60
|
-
|
93
|
+
Yep. Pult API server is running (default port is **7070**).
|
61
94
|
|
62
|
-
Now, you can:
|
95
|
+
Now, for example with `curl`, you can:
|
63
96
|
```bash
|
64
|
-
#
|
65
|
-
|
66
|
-
|
67
|
-
curl
|
68
|
-
curl
|
69
|
-
curl
|
70
|
-
curl
|
71
|
-
curl
|
72
|
-
curl
|
73
|
-
curl
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
# Run
|
78
|
-
curl -X POST
|
79
|
-
|
80
|
-
|
81
|
-
curl -X POST
|
82
|
-
|
83
|
-
|
84
|
-
curl
|
85
|
-
curl
|
86
|
-
curl
|
97
|
+
# GET method is default
|
98
|
+
|
99
|
+
# See source code of actions
|
100
|
+
curl http://localhost:7070/appname/test
|
101
|
+
curl http://localhost:7070/appname/up
|
102
|
+
curl http://localhost:7070/appname/restart
|
103
|
+
curl http://localhost:7070/appname/pull
|
104
|
+
curl http://localhost:7070/appname/prepare
|
105
|
+
curl http://localhost:7070/appname/start
|
106
|
+
curl http://localhost:7070/appname/stop
|
107
|
+
curl http://localhost:7070/appname/log/clean
|
108
|
+
curl http://localhost:7070/appname/log/view
|
109
|
+
|
110
|
+
# Run actions (be careful, can block you runtime)
|
111
|
+
curl -X POST http://localhost:7070/api/appname/test
|
112
|
+
curl -X POST http://localhost:7070/appname/up
|
113
|
+
curl -X POST http://localhost:7070/appname/restart
|
114
|
+
curl -X POST http://localhost:7070/appname/pull
|
115
|
+
curl -X POST http://localhost:7070/appname/prepare
|
116
|
+
curl -X POST http://localhost:7070/appname/start
|
117
|
+
curl -X POST http://localhost:7070/appname/stop
|
118
|
+
curl -X POST http://localhost:7070/appname/log/clean
|
119
|
+
curl -X POST http://localhost:7070/appname/log/view
|
120
|
+
|
121
|
+
# Run actions in a background (asynchronously)
|
122
|
+
curl -X POST http://localhost:7070/appname/test_job
|
123
|
+
curl -X POST http://localhost:7070/appname/up_job
|
124
|
+
curl -X POST http://localhost:7070/appname/restart_job
|
125
|
+
curl -X POST http://localhost:7070/appname/pull_job
|
126
|
+
curl -X POST http://localhost:7070/appname/prepare_job
|
127
|
+
curl -X POST http://localhost:7070/appname/start_job
|
128
|
+
curl -X POST http://localhost:7070/appname/stop_job
|
129
|
+
curl -X POST http://localhost:7070/appname/log/clean_job
|
130
|
+
curl -X POST http://localhost:7070/appname/log/view_job
|
131
|
+
|
132
|
+
# See results of runned actions (STDOUT, STDERR, success status)
|
133
|
+
curl http://localhost:7070/appname/test_out
|
134
|
+
curl http://localhost:7070/appname/test_err
|
135
|
+
curl http://localhost:7070/appname/test_suc
|
136
|
+
curl http://localhost:7070/appname/up_out
|
137
|
+
curl http://localhost:7070/appname/up_err
|
138
|
+
curl http://localhost:7070/appname/up_suc
|
139
|
+
curl http://localhost:7070/appname/restart_out
|
140
|
+
curl http://localhost:7070/appname/restart_err
|
141
|
+
curl http://localhost:7070/appname/restart_suc
|
142
|
+
curl http://localhost:7070/appname/pull_out
|
143
|
+
curl http://localhost:7070/appname/pull_err
|
144
|
+
curl http://localhost:7070/appname/pull_suc
|
145
|
+
curl http://localhost:7070/appname/prepare_out
|
146
|
+
curl http://localhost:7070/appname/prepare_err
|
147
|
+
curl http://localhost:7070/appname/prepare_suc
|
148
|
+
curl http://localhost:7070/appname/start_out
|
149
|
+
curl http://localhost:7070/appname/start_err
|
150
|
+
curl http://localhost:7070/appname/start_suc
|
151
|
+
curl http://localhost:7070/appname/stop_out
|
152
|
+
curl http://localhost:7070/appname/stop_err
|
153
|
+
curl http://localhost:7070/appname/stop_suc
|
154
|
+
curl http://localhost:7070/appname/log/clean_out
|
155
|
+
curl http://localhost:7070/appname/log/clean_err
|
156
|
+
curl http://localhost:7070/appname/log/clean_suc
|
157
|
+
curl http://localhost:7070/appname/log/view_out
|
158
|
+
curl http://localhost:7070/appname/log/view_err
|
159
|
+
curl http://localhost:7070/appname/log/view_suc
|
87
160
|
```
|
88
161
|
|
162
|
+
TODO..
|
163
|
+
|
89
164
|
## Usage: Via Ruby
|
90
165
|
|
91
166
|
TODO..
|
data/example/pult.yml
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
#
|
1
|
+
# actions is a simple linux shell commands
|
2
|
+
|
4
3
|
appname:
|
5
|
-
test: '
|
4
|
+
test: 'sleep 20 && echo 123'
|
6
5
|
|
7
6
|
# allow combine actions of the same level
|
8
7
|
up: [pull, prepare, start]
|
@@ -12,13 +11,13 @@ appname:
|
|
12
11
|
|
13
12
|
prepare: rails assets:precompile
|
14
13
|
|
15
|
-
# if var is upcase, it will be required in API as a param
|
14
|
+
# if var is upcase, it will be required in API as a param
|
16
15
|
start: rails s -e production -p $PORT
|
17
16
|
|
18
|
-
# if var is downcase, it will be not required, just local stuff
|
17
|
+
# if var is downcase, it will be not required, just local stuff
|
19
18
|
stop: f=tmp/pids/server.pid; if [ -f "$f" ]; then rm $f; fi
|
20
19
|
|
21
20
|
# allow grouping actions in sublevels
|
22
21
|
log:
|
23
|
-
clean: >log/production.log
|
22
|
+
clean: '>log/production.log'
|
24
23
|
view: cat log/production.log
|
data/lib/pult/api/drawer.rb
CHANGED
@@ -5,7 +5,7 @@ module Pult::Panel::Injector::Runner
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def self.read_injections
|
8
|
-
%w{ _out _in _err
|
8
|
+
%w{ _out _in _err _suc _inf _act _pid }
|
9
9
|
end
|
10
10
|
|
11
11
|
def self.run_injections
|
@@ -36,19 +36,19 @@ module Pult::Panel::Injector::Runner
|
|
36
36
|
#{action}_runner.stderr
|
37
37
|
end
|
38
38
|
|
39
|
-
def #{action}
|
39
|
+
def #{action}_inf
|
40
40
|
#{action}_runner.info
|
41
41
|
end
|
42
42
|
|
43
|
-
def #{action}
|
44
|
-
#{action}
|
43
|
+
def #{action}_suc
|
44
|
+
#{action}_inf.success?
|
45
45
|
end
|
46
46
|
|
47
47
|
def #{action}_pid
|
48
|
-
#{action}
|
48
|
+
#{action}_inf.pid
|
49
49
|
end
|
50
50
|
|
51
|
-
def #{action}
|
51
|
+
def #{action}_act
|
52
52
|
|
53
53
|
end
|
54
54
|
|
data/lib/pult/version.rb
CHANGED
data/pult.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.authors = ["dmitryck"]
|
12
12
|
spec.email = ["dmitryck@gmail.com"]
|
13
13
|
|
14
|
-
spec.summary = %q{
|
14
|
+
spec.summary = %q{ Universal API service for manage applications and system tasks localy or remotely }
|
15
15
|
spec.homepage = "https://github.com/dmitryck/pult"
|
16
16
|
spec.license = "MIT"
|
17
17
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pult
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dmitryck
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -191,5 +191,6 @@ rubyforge_project:
|
|
191
191
|
rubygems_version: 2.7.6
|
192
192
|
signing_key:
|
193
193
|
specification_version: 4
|
194
|
-
summary:
|
194
|
+
summary: Universal API service for manage applications and system tasks localy or
|
195
|
+
remotely
|
195
196
|
test_files: []
|