Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SET-Payload Schema
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FIT-Connect
SET-Payload Schema
Commits
169b5f93
Verified
Commit
169b5f93
authored
1 year ago
by
Jonas Gröger
Browse files
Options
Downloads
Patches
Plain Diff
refactor(build): simplify shell scripts
parent
2f51b9d4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!14
feat: split authentication tags since replies have required data field (unlike...
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
build.sh
+28
-0
28 additions, 0 deletions
build.sh
bundle.sh
+0
-8
0 additions, 8 deletions
bundle.sh
package.json
+1
-1
1 addition, 1 deletion
package.json
with
29 additions
and
9 deletions
create_examples
.sh
→
build
.sh
+
28
−
0
View file @
169b5f93
#!/usr/bin/env sh
# Create a directory for the examples
rm
-rf
examples
rm
-rf
examples_fail
mkdir
-p
examples
mkdir
examples_fail
# set -euxo pipefail
node scripts/bundle.js spec/set-payload.schema.json
\
dist/set-payload.schema.json
# Run over Templates and create examples
rm
-rf
examples examples_fail
mkdir
-p
examples examples_fail
# Create examples using template files
for
template
in
templates/
*
.json
;
do
# Get the name of the template
template_name
=
$(
basename
$template
)
# Get the name of the e
xa
mple
e
xa
mple_name
=
$
{
template_
name
%.
template
}
# Get the name of the
t
empl
at
e
t
empl
at
e_name
=
$
(
base
name
"
$
template
"
)
# Create the example
set
--
"1.0.0"
"1.0.1"
"1.0.2"
"1.0.11"
"1.1.0"
"1.5.11"
for
version
in
"
$@
"
;
do
cat
$template
|
sed
-e
"s|SCHEMA_VERSION|
$version
|g"
>
./examples/
"
$template_name
"
_
"
$version
"
.json
for
version
in
"
$@
"
;
do
sed
-e
"s|SCHEMA_VERSION|
$version
|g"
"
$template
"
>
./examples/
"
$template_name
"
_
"
$version
"
.json
done
set
--
"2.0.0"
"3.0.1"
"2.0.2"
"2.0.11"
"2.1.0"
"3.5.11"
for
version
in
"
$@
"
;
do
cat
$template
|
sed
-e
"s|SCHEMA_VERSION|
$version
|g"
>
./examples_fail/
"
$template_name
"
_
"
$version
"
.json
for
version
in
"
$@
"
;
do
sed
-e
"s|SCHEMA_VERSION|
$version
|g"
"
$template
"
>
./examples_fail/
"
$template_name
"
_
"
$version
"
.json
done
done
This diff is collapsed.
Click to expand it.
bundle.sh
deleted
100755 → 0
+
0
−
8
View file @
2f51b9d4
#!/usr/bin/env sh
# set -euxo pipefail
node scripts/bundle.js spec/authentication-tags.schema.json dist/authentication-tags.schema.json
node scripts/bundle.js spec/problems.schema.json dist/problems.schema.json
node scripts/bundle.js spec/set-payload.schema.json dist/set-payload.schema.json
sh create_examples.sh
This diff is collapsed.
Click to expand it.
package.json
+
1
−
1
View file @
169b5f93
{
"scripts"
:
{
"bundle"
:
"sh bu
ndle
.sh"
,
"bundle"
:
"sh bu
ild
.sh"
,
"lint"
:
"ajv compile --spec=draft2020 -c ajv-formats -s dist/set-payload.schema.json"
,
"test"
:
"ajv validate --errors=text --verbose --all-errors -d examples/**/*.json --spec=draft2020 -c ajv-formats -s dist/set-payload.schema.json"
,
"test_higher_version"
:
"! ajv validate --errors=text --verbose --all-errors -d examples_fail/**/*.json --spec=draft2020 -c ajv-formats -s dist/set-payload.schema.json"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment