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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 131574120a9bbecd16f9ae3884ce8449c2979ef40f28aac550f9bbb08c35ec2f
4
- data.tar.gz: b269419bfaddb2cdb4724b37447b33dbfbece828bc0e1215d67ebeb7f0b91fbd
3
+ metadata.gz: 308b0fe9ee50de08f18432fac828b5ae189dfed04ca360b7c8b11603cc19c1bc
4
+ data.tar.gz: 605d8aad93efe084bedeb919c2e4375ca6948a73bd2bfe2b3274ab95351e4a76
5
5
  SHA512:
6
- metadata.gz: 5462a9625c8b7f2640b669e47bd67344ab04249a2822a35bb80475f5f51f0097b3dae9b80835a1bccfc5bb3ca6b6798e0a36f7df39312016d9bf517c98a693dc
7
- data.tar.gz: 90fa33a0dd880f6b05f7d52e97d9d4a49bd0c7a2f0f2737bfd4d7bab3a0149da2a7caa3eaa87969f9d9b879ba7699c5c9a070c8c6baa19dbcb549e69d3165d9f
6
+ metadata.gz: c226cd807dc31fa6b21dd95dc225cb4a7139359c7be7bfb510a1e7f89e356f0ea86dfff7fe2ab38f98417ea13ad268fae37536b99173ec2a8ffba267150a40c9
7
+ data.tar.gz: d5045206075175c80afe8448dd5d6d4462efecc60e80572d0c42340f9271f49ae2539433b9bae2ddd93ccf6a8b1d58c142b64f5f44c46874c0ce2221e56742eb
@@ -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
- **Under construction**! This is **Dev** version (0.0.*x*)
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
- Ruby or HTTP interface for your app tasks or services, described in yml file(s).
11
+ Universal API service for manage your appications and system tasks via Ruby or HTTP.
12
12
 
13
- In another words, it is an API, that can be configured and running as a http server, or just been used via Ruby.
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
- ## Usage: Via HTTP server
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
- Put `pult.yml` anywere into your project folder.
28
+ Talking about usage Pult, first of all we need to talk about use cases..
26
29
 
27
- Some kind of `<project>/config/pult.yml`:
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
- # Rails, for example
31
- #
44
+ # actions is a simple linux shell commands
45
+
32
46
  appname:
33
- test: 'pause 20 && echo 123'
47
+ test: 'sleep 20 && echo 123'
34
48
 
35
- # allow combine actions of the same level
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 ($PORT)
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 ($f)
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
- # allow grouping actions in sublevels
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
- Then in your project folder run:
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
- Thats it! Pult API server is running (default port is *7070*).
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
- # See your tasks
65
- curl 'http://localhost:7070/api/appname/test'
66
- curl 'http://localhost:7070/api/appname/up'
67
- curl 'http://localhost:7070/api/appname/restart'
68
- curl 'http://localhost:7070/api/appname/pull'
69
- curl 'http://localhost:7070/api/appname/prepare'
70
- curl 'http://localhost:7070/api/appname/start'
71
- curl 'http://localhost:7070/api/appname/stop'
72
- curl 'http://localhost:7070/api/appname/log/clean'
73
- curl 'http://localhost:7070/api/appname/log/view'
74
-
75
- # Next, test task example only (same for others)
76
-
77
- # Run your tasks 'just in time' (can, but not preferably)
78
- curl -X POST 'http://localhost:7070/api/appname/test'
79
-
80
- # Run your tasks in a background (preferably)
81
- curl -X POST 'http://localhost:7070/api/appname/test_job'
82
-
83
- # See results (Stdout/Stderr, success) of your tasks after running
84
- curl 'http://localhost:7070/api/appname/test_out'
85
- curl 'http://localhost:7070/api/appname/test_err'
86
- curl 'http://localhost:7070/api/appname/test_success'
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..
@@ -1,8 +1,7 @@
1
- #
2
- # rails, for example
3
- #
1
+ # actions is a simple linux shell commands
2
+
4
3
  appname:
5
- test: 'pause 20 && echo 123'
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 ($PORT)
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 ($f)
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
@@ -4,7 +4,8 @@ class Pult::Api::Drawer
4
4
 
5
5
  format :json
6
6
 
7
- prefix PREFIX
7
+ # TODO, temp turn off
8
+ # prefix PREFIX
8
9
 
9
10
  ENV_VAR = /[A-Z][A-Z0-9]*/
10
11
 
@@ -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 _success _info _active _pid }
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}_info
39
+ def #{action}_inf
40
40
  #{action}_runner.info
41
41
  end
42
42
 
43
- def #{action}_success
44
- #{action}_info.success?
43
+ def #{action}_suc
44
+ #{action}_inf.success?
45
45
  end
46
46
 
47
47
  def #{action}_pid
48
- #{action}_info.pid
48
+ #{action}_inf.pid
49
49
  end
50
50
 
51
- def #{action}_active
51
+ def #{action}_act
52
52
 
53
53
  end
54
54
 
@@ -1,3 +1,3 @@
1
1
  module Pult
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
@@ -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{ Pult for your apps or tasks (UNDER CONSTRUCTION) }
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.14
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-13 00:00:00.000000000 Z
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: Pult for your apps or tasks (UNDER CONSTRUCTION)
194
+ summary: Universal API service for manage applications and system tasks localy or
195
+ remotely
195
196
  test_files: []