aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/main.yml18
-rw-r--r--app/Controllers/Http/WorkspaceController.js6
2 files changed, 21 insertions, 3 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 0000000..e21943b
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,18 @@
1name: Trigger Docker Hub build
2
3on:
4 release:
5 types: [published]
6
7jobs:
8 build:
9
10 runs-on: ubuntu-latest
11
12 steps:
13 - name: Install HTTPie
14 run: sudo apt-get install httpie
15
16 - name: Send request to Docker Hub to trigger a build
17 run: >
18 http post https://hub.docker.com/api/build/v1/source/83564f19-c21a-4dae-9690-971aee3b2a3b/trigger/${{ env.HUB_TRIGGER_ID }}/call/'
diff --git a/app/Controllers/Http/WorkspaceController.js b/app/Controllers/Http/WorkspaceController.js
index 7be0e5b..cbb6873 100644
--- a/app/Controllers/Http/WorkspaceController.js
+++ b/app/Controllers/Http/WorkspaceController.js
@@ -73,7 +73,7 @@ class WorkspaceController {
73 73
74 // Validate user input 74 // Validate user input
75 const validation = await validateAll(request.all(), { 75 const validation = await validateAll(request.all(), {
76 name: 'required|alpha', 76 name: 'required',
77 services: 'required|array', 77 services: 'required|array',
78 }); 78 });
79 if (validation.fails()) { 79 if (validation.fails()) {
@@ -124,12 +124,12 @@ class WorkspaceController {
124 } 124 }
125 125
126 // Validate user input 126 // Validate user input
127 const validation = await validateAll(request.all(), { 127 const validation = await validateAll(params, {
128 id: 'required', 128 id: 'required',
129 }); 129 });
130 if (validation.fails()) { 130 if (validation.fails()) {
131 return response.status(401).send({ 131 return response.status(401).send({
132 message: 'Invalid POST arguments', 132 message: 'Invalid arguments',
133 messages: validation.messages(), 133 messages: validation.messages(),
134 status: 401, 134 status: 401,
135 }); 135 });