Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
zapp-tensorflow
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zoe-apps
zapp-tensorflow
Commits
e1366c0f
Commit
e1366c0f
authored
Sep 13, 2017
by
Daniele Venzano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add validate script
parent
7c7c67c0
Pipeline
#4509
canceled with stages
in 23 minutes
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
23 deletions
+18
-23
validate.py
validate.py
+18
-0
validate_all.sh
validate_all.sh
+0
-23
No files found.
validate.py
0 → 100644
View file @
e1366c0f
#!/usr/bin/python
import
json
import
sys
import
requests
URL
=
sys
.
argv
[
1
]
files
=
sys
.
argv
[
2
:]
for
f
in
files
:
data
=
json
.
load
(
open
(
f
,
encoding
=
"utf-8"
))
data_req
=
{
"application"
:
data
}
r
=
requests
.
post
(
URL
,
json
=
data_req
)
if
r
.
status_code
!=
200
:
rep
=
r
.
json
()
print
(
rep
[
'message'
])
sys
.
exit
(
1
)
validate_all.sh
deleted
100644 → 0
View file @
7c7c67c0
#!/bin/bash
set
-e
VALIDATION_URL
=
${
VALIDATION_URL
:-
http
://localhost:5001/api/0.7/zapp_validate
}
tempfile
=
`
mktemp
`
trap
"{ rm -f
$tempfile
; }"
EXIT
for
json
in
*
.json
;
do
if
[
$json
=
"manifest.json"
]
;
then
continue
fi
echo
'{"application":'
>
$tempfile
cat
$json
>>
$tempfile
echo
'}'
>>
$tempfile
if
!
curl
-s
-X
POST
-H
"Content-Type: application/json"
-d
@
$tempfile
-w
"code:%{http_code}"
-o
$tempfile
$VALIDATION_URL
|
grep
'code:200'
;
then
printf
"
`
cat
$tempfile
`
"
echo
exit
1
fi
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment