jets 2.1.1 → 2.1.2
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/.codebuild/README.md +10 -60
- data/.codebuild/docs/bin/build.sh +6 -0
- data/.codebuild/docs/bin/cli_docs.sh +5 -0
- data/.codebuild/docs/bin/git_commit.sh +27 -0
- data/.codebuild/docs/bin/git_setup.sh +19 -0
- data/.codebuild/docs/bin/subnav.sh +14 -0
- data/.codebuild/docs/buildspec.yml +8 -0
- data/.codebuild/docs/project.rb +10 -0
- data/.gitignore +5 -5
- data/CHANGELOG.md +8 -0
- data/jets.gemspec +5 -5
- data/lib/jets/aws_services/stack_status.rb +5 -1
- data/lib/jets/cfn/builders/api_gateway_builder.rb +10 -19
- data/lib/jets/cfn/builders/api_resources_builder.rb +46 -0
- data/lib/jets/cfn/builders/parent_builder.rb +15 -0
- data/lib/jets/cfn/built_template.rb +15 -0
- data/lib/jets/commands/clean/log.rb +18 -1
- data/lib/jets/commands/delete.rb +14 -1
- data/lib/jets/commands/deploy.rb +43 -12
- data/lib/jets/commands/help/build.md +1 -1
- data/lib/jets/commands/help/{destroy.md → degenerate.md} +1 -1
- data/lib/jets/commands/help/upgrade.md +2 -0
- data/lib/jets/commands/main.rb +2 -1
- data/lib/jets/commands/templates/skeleton/Gemfile.tt +1 -0
- data/lib/jets/naming.rb +4 -0
- data/lib/jets/resource/api_gateway/resource.rb +7 -3
- data/lib/jets/resource/api_gateway/rest_api/change_detection.rb +0 -32
- data/lib/jets/resource/api_gateway/rest_api/routes/change.rb +9 -1
- data/lib/jets/resource/api_gateway/rest_api/routes/change/base.rb +26 -5
- data/lib/jets/resource/api_gateway/rest_api/routes/change/media_types.rb +36 -0
- data/lib/jets/resource/api_gateway/rest_api/routes/change/page.rb +93 -0
- data/lib/jets/resource/api_gateway/rest_api/routes/change/to.rb +0 -4
- data/lib/jets/resource/api_gateway/rest_api/routes/change/variable.rb +0 -4
- data/lib/jets/resource/child_stack/api_resource.rb +60 -0
- data/lib/jets/resource/child_stack/api_resource/page.rb +20 -0
- data/lib/jets/resource/child_stack/app_class.rb +14 -3
- data/lib/jets/router.rb +57 -40
- data/lib/jets/router/method_creator/code.rb +3 -1
- data/lib/jets/router/method_creator/edit.rb +6 -1
- data/lib/jets/router/method_creator/index.rb +9 -3
- data/lib/jets/router/method_creator/new.rb +6 -1
- data/lib/jets/router/method_creator/show.rb +6 -1
- data/lib/jets/router/route.rb +1 -0
- data/lib/jets/version.rb +1 -1
- metadata +22 -17
- data/.codebuild/bin/jets +0 -3
- data/.codebuild/buildspec-base.yml +0 -14
- data/.codebuild/integration.sh +0 -72
- data/.codebuild/jets.postman_collection.json +0 -323
- data/.codebuild/scripts/install-docker.sh +0 -12
- data/.codebuild/scripts/install-dynamodb-local.sh +0 -22
- data/.codebuild/scripts/install-java.sh +0 -22
- data/.codebuild/scripts/install-node.sh +0 -4
data/.codebuild/bin/jets
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
version: 0.2
|
2
|
-
|
3
|
-
phases:
|
4
|
-
build:
|
5
|
-
commands:
|
6
|
-
- echo Build started on `date`
|
7
|
-
- mkdir ~/.docker
|
8
|
-
- aws s3 cp s3://$S3_BUCKET_DOCKER_CONFIG/codebuild/jets/docker-config.json ~/.docker/config.json
|
9
|
-
- docker build -t tongueroo/jets:base -f Dockerfile.base .
|
10
|
-
- docker push tongueroo/jets
|
11
|
-
|
12
|
-
artifacts:
|
13
|
-
files:
|
14
|
-
- README.md
|
data/.codebuild/integration.sh
DELETED
@@ -1,72 +0,0 @@
|
|
1
|
-
#!/bin/bash -exu
|
2
|
-
|
3
|
-
# on codebuild make sure we use the bin/jets that was checked out
|
4
|
-
set +u
|
5
|
-
if [ -n "$CODEBUILD_SRC_DIR" ]; then
|
6
|
-
cp .codebuild/bin/jets /usr/local/bin/jets
|
7
|
-
chmod a+x /usr/local/bin/jets
|
8
|
-
export PATH=/usr/local/bin:$PATH
|
9
|
-
which jets
|
10
|
-
fi
|
11
|
-
|
12
|
-
# Locally set the CODEBUILD_SRC_DIR to make script simpler
|
13
|
-
# Do this before the cd-ing into the newly created directory.
|
14
|
-
if [ -z $CODEBUILD_SRC_DIR ]; then
|
15
|
-
CODEBUILD_SRC_DIR=$(pwd)
|
16
|
-
fi
|
17
|
-
set -u
|
18
|
-
|
19
|
-
APP_NAME=demo$(date +%s)
|
20
|
-
jets new $APP_NAME # jets new runs bundle and webpacker:install
|
21
|
-
cd $APP_NAME
|
22
|
-
|
23
|
-
cat >.env.development <<EOL
|
24
|
-
DB_NAME=$DB_NAME
|
25
|
-
DB_USER=$DB_USER
|
26
|
-
DB_PASS=$DB_PASS
|
27
|
-
DB_HOST=$DB_HOST
|
28
|
-
EOL
|
29
|
-
# IE: replace demo with demo1535227161 in case locally using demo and forget to set
|
30
|
-
perl -i -pe "s/DB_NAME=demo/DB_NAME=${APP_NAME}_dev/" .env.development
|
31
|
-
# Make sure database env vars matches whats in the file
|
32
|
-
eval $(cat .env.development | sed 's/^/export /')
|
33
|
-
# Make sure that nothing is .env.development.remote, dont want to use it for this case
|
34
|
-
cp /dev/null .env.development.remote
|
35
|
-
|
36
|
-
jets generate scaffold Post title:string
|
37
|
-
# The DB_ environment variables are set up in the circleci environment variables
|
38
|
-
# website GUI under project settings
|
39
|
-
jets db:create db:migrate
|
40
|
-
|
41
|
-
jets deploy
|
42
|
-
|
43
|
-
APP_URL=$(jets url)
|
44
|
-
cat > jets.postman_environment.json <<EOL
|
45
|
-
{
|
46
|
-
"id": "f50e05e5-c6dd-4707-9270-82c706b2bcef",
|
47
|
-
"name": "Jets Test1",
|
48
|
-
"values": [
|
49
|
-
{
|
50
|
-
"key": "BASE_URL",
|
51
|
-
"value": "${APP_URL}/",
|
52
|
-
"description": "",
|
53
|
-
"type": "text",
|
54
|
-
"enabled": true
|
55
|
-
}
|
56
|
-
],
|
57
|
-
"_postman_variable_scope": "environment",
|
58
|
-
"_postman_exported_at": "2018-08-06T01:39:56.523Z",
|
59
|
-
"_postman_exported_using": "Postman/6.2.3"
|
60
|
-
}
|
61
|
-
EOL
|
62
|
-
|
63
|
-
cp $CODEBUILD_SRC_DIR/.codebuild/jets.postman_collection.json .
|
64
|
-
|
65
|
-
npm install -g newman
|
66
|
-
newman run jets.postman_collection.json -e jets.postman_environment.json
|
67
|
-
|
68
|
-
# cleanup the database
|
69
|
-
jets db:drop
|
70
|
-
|
71
|
-
# delete jets project
|
72
|
-
jets delete --sure --no-wait
|
@@ -1,323 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"info": {
|
3
|
-
"_postman_id": "c8ca4bd7-c5f4-4e75-95a3-e50290a06661",
|
4
|
-
"name": "Jets Integration Tests",
|
5
|
-
"description": "Tests basic CRUD",
|
6
|
-
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
|
7
|
-
},
|
8
|
-
"item": [
|
9
|
-
{
|
10
|
-
"_postman_id": "154ebb9d-4235-4d4b-9984-d5e3ab3c20d5",
|
11
|
-
"name": "PostsController#index",
|
12
|
-
"event": [
|
13
|
-
{
|
14
|
-
"listen": "test",
|
15
|
-
"script": {
|
16
|
-
"id": "f91acb11-eee6-4c83-956e-ef21f4adf246",
|
17
|
-
"type": "text/javascript",
|
18
|
-
"exec": [
|
19
|
-
"pm.test(\"response is ok\", function () {",
|
20
|
-
" pm.response.to.have.status(200);",
|
21
|
-
"});",
|
22
|
-
"",
|
23
|
-
"pm.test(\"Content-Type is present\", function () {",
|
24
|
-
" pm.response.to.have.header(\"Content-Type\");",
|
25
|
-
"});"
|
26
|
-
]
|
27
|
-
}
|
28
|
-
}
|
29
|
-
],
|
30
|
-
"request": {
|
31
|
-
"method": "GET",
|
32
|
-
"header": [],
|
33
|
-
"body": {},
|
34
|
-
"url": {
|
35
|
-
"raw": "{{BASE_URL}}posts",
|
36
|
-
"host": [
|
37
|
-
"{{BASE_URL}}posts"
|
38
|
-
]
|
39
|
-
}
|
40
|
-
},
|
41
|
-
"response": []
|
42
|
-
},
|
43
|
-
{
|
44
|
-
"_postman_id": "7c6d9207-3303-4d9c-8628-3ec9fdbdd56f",
|
45
|
-
"name": "PostsController#create",
|
46
|
-
"event": [
|
47
|
-
{
|
48
|
-
"listen": "test",
|
49
|
-
"script": {
|
50
|
-
"id": "4f349f21-09e6-436d-bd70-89324ad334e8",
|
51
|
-
"type": "text/javascript",
|
52
|
-
"exec": [
|
53
|
-
"pm.test(\"response is ok\", function () {",
|
54
|
-
" pm.response.to.have.status(200);",
|
55
|
-
"});",
|
56
|
-
"",
|
57
|
-
"pm.test(\"Content-Type is present\", function () {",
|
58
|
-
" pm.response.to.have.header(\"Content-Type\");",
|
59
|
-
"});",
|
60
|
-
"",
|
61
|
-
"pm.test(\"Body matches string\", function () {",
|
62
|
-
" pm.expect(pm.response.text()).to.include(\"test1\");",
|
63
|
-
"});"
|
64
|
-
]
|
65
|
-
}
|
66
|
-
}
|
67
|
-
],
|
68
|
-
"request": {
|
69
|
-
"method": "POST",
|
70
|
-
"header": [
|
71
|
-
{
|
72
|
-
"key": "Content-Type",
|
73
|
-
"value": "application/x-www-form-urlencoded"
|
74
|
-
}
|
75
|
-
],
|
76
|
-
"body": {
|
77
|
-
"mode": "raw",
|
78
|
-
"raw": "utf8=%E2%9C%93&post%5Btitle%5D=test1&post%5Bbody%5D=test1&commit=Submit"
|
79
|
-
},
|
80
|
-
"url": {
|
81
|
-
"raw": "{{BASE_URL}}posts",
|
82
|
-
"host": [
|
83
|
-
"{{BASE_URL}}posts"
|
84
|
-
]
|
85
|
-
}
|
86
|
-
},
|
87
|
-
"response": []
|
88
|
-
},
|
89
|
-
{
|
90
|
-
"_postman_id": "4be8797b-1da7-4386-96b9-f2a2d3bfff16",
|
91
|
-
"name": "PostsController#new",
|
92
|
-
"event": [
|
93
|
-
{
|
94
|
-
"listen": "test",
|
95
|
-
"script": {
|
96
|
-
"id": "7ece5182-aacd-45b9-ba1e-52552f5843cb",
|
97
|
-
"type": "text/javascript",
|
98
|
-
"exec": [
|
99
|
-
"pm.test(\"response is ok\", function () {",
|
100
|
-
" pm.response.to.have.status(200);",
|
101
|
-
"});",
|
102
|
-
"",
|
103
|
-
"pm.test(\"Content-Type is present\", function () {",
|
104
|
-
" pm.response.to.have.header(\"Content-Type\");",
|
105
|
-
"});",
|
106
|
-
""
|
107
|
-
]
|
108
|
-
}
|
109
|
-
}
|
110
|
-
],
|
111
|
-
"request": {
|
112
|
-
"method": "GET",
|
113
|
-
"header": [],
|
114
|
-
"body": {},
|
115
|
-
"url": {
|
116
|
-
"raw": "{{BASE_URL}}posts/new",
|
117
|
-
"host": [
|
118
|
-
"{{BASE_URL}}posts"
|
119
|
-
],
|
120
|
-
"path": [
|
121
|
-
"new"
|
122
|
-
]
|
123
|
-
}
|
124
|
-
},
|
125
|
-
"response": []
|
126
|
-
},
|
127
|
-
{
|
128
|
-
"_postman_id": "8389acfe-5b9a-489e-b9ff-97cc32e9a899",
|
129
|
-
"name": "PostsController#edit",
|
130
|
-
"event": [
|
131
|
-
{
|
132
|
-
"listen": "test",
|
133
|
-
"script": {
|
134
|
-
"id": "f3ac4857-58f8-40b0-8161-d2e2d6d921f3",
|
135
|
-
"type": "text/javascript",
|
136
|
-
"exec": [
|
137
|
-
"pm.test(\"response is ok\", function () {",
|
138
|
-
" pm.response.to.have.status(200);",
|
139
|
-
"});",
|
140
|
-
"",
|
141
|
-
"pm.test(\"Content-Type is present\", function () {",
|
142
|
-
" pm.response.to.have.header(\"Content-Type\");",
|
143
|
-
"});",
|
144
|
-
""
|
145
|
-
]
|
146
|
-
}
|
147
|
-
}
|
148
|
-
],
|
149
|
-
"request": {
|
150
|
-
"method": "GET",
|
151
|
-
"header": [],
|
152
|
-
"body": {},
|
153
|
-
"url": {
|
154
|
-
"raw": "{{BASE_URL}}posts/1/edit",
|
155
|
-
"host": [
|
156
|
-
"{{BASE_URL}}posts"
|
157
|
-
],
|
158
|
-
"path": [
|
159
|
-
"1",
|
160
|
-
"edit"
|
161
|
-
]
|
162
|
-
}
|
163
|
-
},
|
164
|
-
"response": []
|
165
|
-
},
|
166
|
-
{
|
167
|
-
"_postman_id": "22161f8e-1387-44b0-a890-edda95e8ebaf",
|
168
|
-
"name": "PostsController#update",
|
169
|
-
"event": [
|
170
|
-
{
|
171
|
-
"listen": "test",
|
172
|
-
"script": {
|
173
|
-
"id": "f597eb8f-34ea-461b-8793-3c257480f315",
|
174
|
-
"type": "text/javascript",
|
175
|
-
"exec": [
|
176
|
-
"pm.test(\"response is ok\", function () {",
|
177
|
-
" pm.response.to.have.status(200);",
|
178
|
-
"});",
|
179
|
-
"",
|
180
|
-
"pm.test(\"Content-Type is present\", function () {",
|
181
|
-
" pm.response.to.have.header(\"Content-Type\");",
|
182
|
-
"});",
|
183
|
-
"",
|
184
|
-
"pm.test(\"Success json response\", function () {",
|
185
|
-
" var jsonData = pm.response.json();",
|
186
|
-
" pm.expect(jsonData.success).to.eql(true);",
|
187
|
-
"});"
|
188
|
-
]
|
189
|
-
}
|
190
|
-
}
|
191
|
-
],
|
192
|
-
"request": {
|
193
|
-
"method": "PUT",
|
194
|
-
"header": [
|
195
|
-
{
|
196
|
-
"key": "Content-Type",
|
197
|
-
"value": "application/x-www-form-urlencoded; charset=UTF-8"
|
198
|
-
}
|
199
|
-
],
|
200
|
-
"body": {
|
201
|
-
"mode": "raw",
|
202
|
-
"raw": "utf8=%E2%9C%93&_method=put&post%5Btitle%5D=test1edit&post%5Bbody%5D=test1"
|
203
|
-
},
|
204
|
-
"url": {
|
205
|
-
"raw": "{{BASE_URL}}posts/1",
|
206
|
-
"host": [
|
207
|
-
"{{BASE_URL}}posts"
|
208
|
-
],
|
209
|
-
"path": [
|
210
|
-
"1"
|
211
|
-
]
|
212
|
-
}
|
213
|
-
},
|
214
|
-
"response": []
|
215
|
-
},
|
216
|
-
{
|
217
|
-
"_postman_id": "17a8cbb5-ead2-4949-9103-4dba5fb65309",
|
218
|
-
"name": "PostsController#create2",
|
219
|
-
"event": [
|
220
|
-
{
|
221
|
-
"listen": "test",
|
222
|
-
"script": {
|
223
|
-
"id": "100b5476-2194-4d25-8170-3b3416b2c9e2",
|
224
|
-
"type": "text/javascript",
|
225
|
-
"exec": [
|
226
|
-
"pm.test(\"response is ok\", function () {",
|
227
|
-
" pm.response.to.have.status(200);",
|
228
|
-
"});",
|
229
|
-
"",
|
230
|
-
"pm.test(\"Content-Type is present\", function () {",
|
231
|
-
" pm.response.to.have.header(\"Content-Type\");",
|
232
|
-
"});",
|
233
|
-
"",
|
234
|
-
"pm.test(\"Body matches string\", function () {",
|
235
|
-
" pm.expect(pm.response.text()).to.include(\"test2\");",
|
236
|
-
"});"
|
237
|
-
]
|
238
|
-
}
|
239
|
-
}
|
240
|
-
],
|
241
|
-
"request": {
|
242
|
-
"method": "POST",
|
243
|
-
"header": [
|
244
|
-
{
|
245
|
-
"key": "Content-Type",
|
246
|
-
"value": "application/x-www-form-urlencoded"
|
247
|
-
}
|
248
|
-
],
|
249
|
-
"body": {
|
250
|
-
"mode": "raw",
|
251
|
-
"raw": "utf8=%E2%9C%93&post%5Btitle%5D=test2&post%5Bbody%5D=test2&commit=Submit"
|
252
|
-
},
|
253
|
-
"url": {
|
254
|
-
"raw": "{{BASE_URL}}posts",
|
255
|
-
"host": [
|
256
|
-
"{{BASE_URL}}posts"
|
257
|
-
]
|
258
|
-
}
|
259
|
-
},
|
260
|
-
"response": []
|
261
|
-
},
|
262
|
-
{
|
263
|
-
"_postman_id": "c18f1c89-b15d-429a-bc1f-e58630802cba",
|
264
|
-
"name": "PostsController#delete",
|
265
|
-
"event": [
|
266
|
-
{
|
267
|
-
"listen": "test",
|
268
|
-
"script": {
|
269
|
-
"id": "530e0c60-e3c3-4812-82d9-f3072ddb3995",
|
270
|
-
"type": "text/javascript",
|
271
|
-
"exec": [
|
272
|
-
"pm.test(\"response is ok\", function () {",
|
273
|
-
" pm.response.to.have.status(200);",
|
274
|
-
"});",
|
275
|
-
"",
|
276
|
-
"pm.test(\"Content-Type is present\", function () {",
|
277
|
-
" pm.response.to.have.header(\"Content-Type\");",
|
278
|
-
"});",
|
279
|
-
""
|
280
|
-
]
|
281
|
-
}
|
282
|
-
}
|
283
|
-
],
|
284
|
-
"request": {
|
285
|
-
"method": "DELETE",
|
286
|
-
"header": [],
|
287
|
-
"body": {},
|
288
|
-
"url": {
|
289
|
-
"raw": "{{BASE_URL}}posts/2",
|
290
|
-
"host": [
|
291
|
-
"{{BASE_URL}}posts"
|
292
|
-
],
|
293
|
-
"path": [
|
294
|
-
"2"
|
295
|
-
]
|
296
|
-
}
|
297
|
-
},
|
298
|
-
"response": []
|
299
|
-
}
|
300
|
-
],
|
301
|
-
"event": [
|
302
|
-
{
|
303
|
-
"listen": "prerequest",
|
304
|
-
"script": {
|
305
|
-
"id": "a85e6949-f311-4c79-923c-46b55b7fb3e6",
|
306
|
-
"type": "text/javascript",
|
307
|
-
"exec": [
|
308
|
-
""
|
309
|
-
]
|
310
|
-
}
|
311
|
-
},
|
312
|
-
{
|
313
|
-
"listen": "test",
|
314
|
-
"script": {
|
315
|
-
"id": "7b5709b5-7a77-43b6-acfb-abee4a9362ff",
|
316
|
-
"type": "text/javascript",
|
317
|
-
"exec": [
|
318
|
-
""
|
319
|
-
]
|
320
|
-
}
|
321
|
-
}
|
322
|
-
]
|
323
|
-
}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
#!/bin/bash -eux
|
2
|
-
|
3
|
-
# docker client
|
4
|
-
# https://docs.docker.com/install/linux/docker-ce/debian/#install-using-the-convenience-script
|
5
|
-
# Install docker client because we're going to use docker to
|
6
|
-
curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh
|
7
|
-
|
8
|
-
# docker-compose
|
9
|
-
# to find latest releases:
|
10
|
-
# https://github.com/docker/compose/releases
|
11
|
-
curl -s -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
|
12
|
-
chmod +x /usr/local/bin/docker-compose
|
@@ -1,22 +0,0 @@
|
|
1
|
-
#!/bin/bash -eux
|
2
|
-
|
3
|
-
mkdir -p /usr/local/dynamodb_local
|
4
|
-
curl -s https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz -o /usr/local/dynamodb_local/dynamodb_local_latest.tar.gz
|
5
|
-
cd /usr/local/dynamodb_local
|
6
|
-
tar zxf dynamodb_local_latest.tar.gz
|
7
|
-
|
8
|
-
cat > /usr/local/bin/dynamodb-local <<EOL
|
9
|
-
#!/bin/bash
|
10
|
-
|
11
|
-
# for dynamodb-local and dynamodb-admin
|
12
|
-
# More details: https://github.com/tongueroo/jets/wiki/Dynamodb-Local-Setup-Walkthrough
|
13
|
-
export AWS_SECRET_ACCESS_KEY=fakekey
|
14
|
-
export AWS_ACCESS_KEY_ID=fakeid
|
15
|
-
|
16
|
-
# Based on: https://github.com/Homebrew/homebrew-cask/blob/master/Casks/dynamodb-local.rb
|
17
|
-
# I manually extracted out the dynamodb local tar to /opt/dynamodb_local
|
18
|
-
cd /usr/local/dynamodb_local
|
19
|
-
|
20
|
-
exec java -Djava.library.path='./DynamoDBLocal_lib' -jar 'DynamoDBLocal.jar' "$@" 2>&1 &
|
21
|
-
EOL
|
22
|
-
chmod a+x /usr/local/bin/dynamodb-local
|