hiiro 0.1.154 → 0.1.155
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/examples/services.yml +289 -0
- data/lib/hiiro/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bbe44699de1ea172d5b4d18436f3aae2e7fec81e0350f66aef04646c452e259d
|
|
4
|
+
data.tar.gz: c91fba3e8f92db14f581af937b103ef3a87c52f993fe306a64a629b2420d0aee
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 274b382097248a427e5300634e6928a92c2ce2135742fcd8ad9fea5c6f822f8e882445a82b3b6879c1062b5a86d19a86675b5c263d1e811fd7f3fede11b5af4f
|
|
7
|
+
data.tar.gz: 6cc068ece0ed1b5efcad1238ab14c42115364c33af8850781ef1e8dbca4bd5af751b53a33b421e8a95d12fa5d3bdcc6725a39682dade5356591cefb0c1ed1b50
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
# Example services.yml
|
|
2
|
+
# Place at ~/.config/hiiro/services.yml
|
|
3
|
+
#
|
|
4
|
+
# Base env templates referenced by base_env live in:
|
|
5
|
+
# ~/.config/hiiro/env_templates/
|
|
6
|
+
|
|
7
|
+
# =============================================================================
|
|
8
|
+
# Simple service - single start command, no env files
|
|
9
|
+
# =============================================================================
|
|
10
|
+
redis:
|
|
11
|
+
base_dir: ""
|
|
12
|
+
host: localhost
|
|
13
|
+
port: 6379
|
|
14
|
+
start:
|
|
15
|
+
- redis-server
|
|
16
|
+
|
|
17
|
+
# Usage:
|
|
18
|
+
# h service start redis
|
|
19
|
+
# h service stop redis # sends C-c
|
|
20
|
+
|
|
21
|
+
# =============================================================================
|
|
22
|
+
# Rails API - multiple init steps, single env file with variations
|
|
23
|
+
# =============================================================================
|
|
24
|
+
api-rails:
|
|
25
|
+
base_dir: ~/work/api
|
|
26
|
+
host: localhost
|
|
27
|
+
port: 3000
|
|
28
|
+
init:
|
|
29
|
+
- bundle install
|
|
30
|
+
- bin/rails db:migrate
|
|
31
|
+
start:
|
|
32
|
+
- bundle exec rails s -p 3000
|
|
33
|
+
cleanup:
|
|
34
|
+
- rm -f tmp/pids/server.pid
|
|
35
|
+
env_files:
|
|
36
|
+
- env_file: .env.development
|
|
37
|
+
base_env: api-rails.env
|
|
38
|
+
env_vars:
|
|
39
|
+
DATABASE_URL:
|
|
40
|
+
variations:
|
|
41
|
+
local: postgres://localhost:5432/api_dev
|
|
42
|
+
docker: postgres://db:5432/api_dev
|
|
43
|
+
staging: postgres://readonly:pass@staging-db.internal:5432/api
|
|
44
|
+
REDIS_URL:
|
|
45
|
+
variations:
|
|
46
|
+
local: redis://localhost:6379
|
|
47
|
+
docker: redis://redis:6379
|
|
48
|
+
LOG_LEVEL:
|
|
49
|
+
variations:
|
|
50
|
+
local: debug
|
|
51
|
+
quiet: warn
|
|
52
|
+
|
|
53
|
+
# Usage:
|
|
54
|
+
# h service start api-rails
|
|
55
|
+
# -> uses "local" for all variations (DATABASE_URL=postgres://localhost..., REDIS_URL=redis://localhost..., LOG_LEVEL=debug)
|
|
56
|
+
#
|
|
57
|
+
# h service start api-rails --use DATABASE_URL=docker --use REDIS_URL=docker
|
|
58
|
+
# -> uses docker DB and redis, LOG_LEVEL defaults to "local" (debug)
|
|
59
|
+
#
|
|
60
|
+
# h service start api-rails --use DATABASE_URL=staging --use LOG_LEVEL=quiet
|
|
61
|
+
# -> connects to staging DB (readonly), quiet logging, REDIS_URL defaults to local
|
|
62
|
+
#
|
|
63
|
+
# h service start api-rails --use LOG_LEVEL=quiet
|
|
64
|
+
# -> everything local except warn-level logging
|
|
65
|
+
|
|
66
|
+
# =============================================================================
|
|
67
|
+
# GraphQL service - multiple env files
|
|
68
|
+
# =============================================================================
|
|
69
|
+
graphql:
|
|
70
|
+
base_dir: ~/work/graphql
|
|
71
|
+
host: localhost
|
|
72
|
+
port: 4000
|
|
73
|
+
init:
|
|
74
|
+
- npm install
|
|
75
|
+
start:
|
|
76
|
+
- npm run dev
|
|
77
|
+
env_files:
|
|
78
|
+
- env_file: .env.local
|
|
79
|
+
base_env: graphql.env
|
|
80
|
+
env_vars:
|
|
81
|
+
API_URL:
|
|
82
|
+
variations:
|
|
83
|
+
local: http://localhost:3000
|
|
84
|
+
staging: https://api.staging.example.com
|
|
85
|
+
production: https://api.example.com
|
|
86
|
+
AUTH_PROVIDER:
|
|
87
|
+
variations:
|
|
88
|
+
local: http://localhost:8080/auth
|
|
89
|
+
staging: https://auth.staging.example.com
|
|
90
|
+
production: https://auth.example.com
|
|
91
|
+
- env_file: .env.test
|
|
92
|
+
base_env: graphql-test.env
|
|
93
|
+
env_vars:
|
|
94
|
+
API_URL:
|
|
95
|
+
variations:
|
|
96
|
+
local: http://localhost:3001
|
|
97
|
+
mock: http://localhost:9999
|
|
98
|
+
|
|
99
|
+
# Usage:
|
|
100
|
+
# h service start graphql
|
|
101
|
+
# -> writes BOTH env files:
|
|
102
|
+
# .env.local gets API_URL=http://localhost:3000, AUTH_PROVIDER=http://localhost:8080/auth
|
|
103
|
+
# .env.test gets API_URL=http://localhost:3001
|
|
104
|
+
#
|
|
105
|
+
# h service start graphql --use API_URL=staging --use AUTH_PROVIDER=staging
|
|
106
|
+
# -> .env.local gets API_URL=https://api.staging.example.com, AUTH_PROVIDER=https://auth.staging.example.com
|
|
107
|
+
# .env.test gets API_URL=http://localhost:3001 (no "staging" variation defined for .env.test, falls back to "local")
|
|
108
|
+
#
|
|
109
|
+
# h service start graphql --use API_URL=mock
|
|
110
|
+
# -> .env.local gets API_URL=http://localhost:3000 (no "mock" variation in .env.local, falls back to "local")
|
|
111
|
+
# .env.test gets API_URL=http://localhost:9999 (uses "mock" variation)
|
|
112
|
+
#
|
|
113
|
+
# h service start graphql --use API_URL=production --use AUTH_PROVIDER=production
|
|
114
|
+
# -> .env.local gets API_URL=https://api.example.com, AUTH_PROVIDER=https://auth.example.com
|
|
115
|
+
# .env.test gets API_URL=http://localhost:3001 (no "production" defined, falls back to "local")
|
|
116
|
+
|
|
117
|
+
# =============================================================================
|
|
118
|
+
# Frontend - depends on graphql URL
|
|
119
|
+
# =============================================================================
|
|
120
|
+
frontend:
|
|
121
|
+
base_dir: ~/work/frontend
|
|
122
|
+
host: localhost
|
|
123
|
+
port: 8080
|
|
124
|
+
start:
|
|
125
|
+
- npm run dev
|
|
126
|
+
env_files:
|
|
127
|
+
- env_file: .env.local
|
|
128
|
+
base_env: frontend.env
|
|
129
|
+
env_vars:
|
|
130
|
+
GRAPHQL_URL:
|
|
131
|
+
variations:
|
|
132
|
+
local: http://localhost:4000/graphql
|
|
133
|
+
staging: https://graphql.staging.example.com/graphql
|
|
134
|
+
production: https://graphql.example.com/graphql
|
|
135
|
+
FEATURE_FLAGS:
|
|
136
|
+
variations:
|
|
137
|
+
local: all
|
|
138
|
+
staging: released
|
|
139
|
+
production: released
|
|
140
|
+
|
|
141
|
+
# Usage:
|
|
142
|
+
# h service start frontend
|
|
143
|
+
# -> GRAPHQL_URL=http://localhost:4000/graphql, FEATURE_FLAGS=all
|
|
144
|
+
#
|
|
145
|
+
# h service start frontend --use GRAPHQL_URL=staging --use FEATURE_FLAGS=staging
|
|
146
|
+
# -> GRAPHQL_URL=https://graphql.staging.example.com/graphql, FEATURE_FLAGS=released
|
|
147
|
+
|
|
148
|
+
# =============================================================================
|
|
149
|
+
# Worker with custom stop command
|
|
150
|
+
# =============================================================================
|
|
151
|
+
sidekiq:
|
|
152
|
+
base_dir: ~/work/api
|
|
153
|
+
host: localhost
|
|
154
|
+
port: ""
|
|
155
|
+
start:
|
|
156
|
+
- bundle exec sidekiq -C config/sidekiq.yml
|
|
157
|
+
stop: "pkill -f sidekiq"
|
|
158
|
+
env_files:
|
|
159
|
+
- env_file: .env.development
|
|
160
|
+
base_env: api-rails.env
|
|
161
|
+
env_vars:
|
|
162
|
+
REDIS_URL:
|
|
163
|
+
variations:
|
|
164
|
+
local: redis://localhost:6379
|
|
165
|
+
docker: redis://redis:6379
|
|
166
|
+
|
|
167
|
+
# Usage:
|
|
168
|
+
# h service start sidekiq
|
|
169
|
+
# h service stop sidekiq # runs "pkill -f sidekiq" instead of C-c
|
|
170
|
+
|
|
171
|
+
# =============================================================================
|
|
172
|
+
# Multi-command start - seed data then launch
|
|
173
|
+
# =============================================================================
|
|
174
|
+
demo-server:
|
|
175
|
+
base_dir: ~/work/demo
|
|
176
|
+
host: localhost
|
|
177
|
+
port: 5000
|
|
178
|
+
init:
|
|
179
|
+
- npm install
|
|
180
|
+
start:
|
|
181
|
+
- npm run db:seed
|
|
182
|
+
- npm run build:assets
|
|
183
|
+
- npm start
|
|
184
|
+
env_files:
|
|
185
|
+
- env_file: .env
|
|
186
|
+
base_env: demo.env
|
|
187
|
+
env_vars:
|
|
188
|
+
DEMO_MODE:
|
|
189
|
+
variations:
|
|
190
|
+
local: full
|
|
191
|
+
lite: minimal
|
|
192
|
+
|
|
193
|
+
# Usage:
|
|
194
|
+
# h service start demo-server
|
|
195
|
+
# -> creates a script that runs: db:seed && build:assets && start
|
|
196
|
+
# -> DEMO_MODE=full
|
|
197
|
+
#
|
|
198
|
+
# h service start demo-server --use DEMO_MODE=lite
|
|
199
|
+
# -> same commands, DEMO_MODE=minimal
|
|
200
|
+
|
|
201
|
+
# =============================================================================
|
|
202
|
+
# SERVICE GROUPS
|
|
203
|
+
# =============================================================================
|
|
204
|
+
|
|
205
|
+
# Full local stack - everything pointing at localhost
|
|
206
|
+
full-stack:
|
|
207
|
+
services:
|
|
208
|
+
- name: redis
|
|
209
|
+
- name: api-rails
|
|
210
|
+
use:
|
|
211
|
+
DATABASE_URL: local
|
|
212
|
+
REDIS_URL: local
|
|
213
|
+
LOG_LEVEL: local
|
|
214
|
+
- name: graphql
|
|
215
|
+
use:
|
|
216
|
+
API_URL: local
|
|
217
|
+
AUTH_PROVIDER: local
|
|
218
|
+
- name: frontend
|
|
219
|
+
use:
|
|
220
|
+
GRAPHQL_URL: local
|
|
221
|
+
FEATURE_FLAGS: local
|
|
222
|
+
|
|
223
|
+
# Usage:
|
|
224
|
+
# h service start full-stack
|
|
225
|
+
# -> creates ONE tmux window with 4 split panes (redis, api-rails, graphql, frontend)
|
|
226
|
+
# -> all services use "local" variations
|
|
227
|
+
|
|
228
|
+
# Frontend + GraphQL against staging API (no local rails needed)
|
|
229
|
+
staging-fe:
|
|
230
|
+
services:
|
|
231
|
+
- name: graphql
|
|
232
|
+
use:
|
|
233
|
+
API_URL: staging
|
|
234
|
+
AUTH_PROVIDER: staging
|
|
235
|
+
- name: frontend
|
|
236
|
+
use:
|
|
237
|
+
GRAPHQL_URL: local
|
|
238
|
+
FEATURE_FLAGS: staging
|
|
239
|
+
|
|
240
|
+
# Usage:
|
|
241
|
+
# h service start staging-fe
|
|
242
|
+
# -> ONE tmux window, 2 split panes
|
|
243
|
+
# -> graphql points at staging API/auth
|
|
244
|
+
# -> frontend points at local graphql (which proxies to staging)
|
|
245
|
+
|
|
246
|
+
# Backend only - rails + sidekiq + redis, docker DB
|
|
247
|
+
backend-docker:
|
|
248
|
+
services:
|
|
249
|
+
- name: redis
|
|
250
|
+
- name: api-rails
|
|
251
|
+
use:
|
|
252
|
+
DATABASE_URL: docker
|
|
253
|
+
REDIS_URL: docker
|
|
254
|
+
LOG_LEVEL: local
|
|
255
|
+
- name: sidekiq
|
|
256
|
+
use:
|
|
257
|
+
REDIS_URL: docker
|
|
258
|
+
|
|
259
|
+
# Usage:
|
|
260
|
+
# h service start backend-docker
|
|
261
|
+
# -> 3 split panes: redis, api-rails, sidekiq
|
|
262
|
+
# -> all using docker postgres and redis URLs
|
|
263
|
+
|
|
264
|
+
# =============================================================================
|
|
265
|
+
# QUICK REFERENCE - all start commands
|
|
266
|
+
# =============================================================================
|
|
267
|
+
#
|
|
268
|
+
# Start with defaults (all "local" variations):
|
|
269
|
+
# h service start <name>
|
|
270
|
+
#
|
|
271
|
+
# Start with specific variations:
|
|
272
|
+
# h service start <name> --use VAR=variation
|
|
273
|
+
# h service start <name> --use VAR1=v1 --use VAR2=v2
|
|
274
|
+
#
|
|
275
|
+
# Start a group (pre-configured variation combos):
|
|
276
|
+
# h service start <group-name>
|
|
277
|
+
#
|
|
278
|
+
# Interactive selection (no name):
|
|
279
|
+
# h service start
|
|
280
|
+
#
|
|
281
|
+
# Other commands:
|
|
282
|
+
# h service stop [name] # C-c (or custom stop cmd), fuzzy select if no name
|
|
283
|
+
# h service attach [name] # switch to service's tmux pane
|
|
284
|
+
# h service status [name] # show service details
|
|
285
|
+
# h service reset [name] # clear stale running state
|
|
286
|
+
# h service clean # auto-prune dead panes from state
|
|
287
|
+
# h service ls # list all services + status
|
|
288
|
+
# h service env <name> # show env file config and variations
|
|
289
|
+
# h service groups # list all groups and members
|
data/lib/hiiro/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hiiro
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.155
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joshua Toyota
|
|
@@ -113,6 +113,7 @@ files:
|
|
|
113
113
|
- docs/h-session.md
|
|
114
114
|
- docs/h-window.md
|
|
115
115
|
- editboth
|
|
116
|
+
- examples/services.yml
|
|
116
117
|
- exe/h
|
|
117
118
|
- exe/hiiro
|
|
118
119
|
- h-tmux-plugins.tmux
|