Skip to content

Commit

Permalink
chore(ci): validate json [EE-6391] (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
chiptus committed Dec 13, 2023
1 parent 8667ea4 commit 9603167
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 25 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Validate JSONs

on:
pull_request:
push:
branches:
- v3

jobs:
verify-json-validation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Validate JSON
uses: docker://orrosenblatt/validate-json-action:latest
env:
INPUT_SCHEMA: ./schema.json
INPUT_JSONS: ./templates.json
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ For more information about the template definition format and how to deploy your

## Notice

Since version 3 of the templates, we've moved to use `main` branch as the default branch for this repository. If you are using version 2, please use the `master` branch of this repository (or https://raw.githubusercontent.com/portainer/templates/master/templates-2.0.json).
Since version 3 of the templates, we've moved to use `v3` branch as the default branch for this repository. If you are using version 2, please use the `master` branch of this repository (or https://raw.githubusercontent.com/portainer/templates/master/templates-2.0.json).
99 changes: 99 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"version": {
"type": "string"
},
"templates": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"type": {
"type": "integer",
"enum": [1, 2, 3]
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"categories": {
"type": "array",
"items": {
"type": "string"
}
},
"platform": {
"type": "string"
},
"logo": {
"type": "string",
"format": "uri"
},
"image": {
"type": "string"
},
"ports": {
"type": "array",
"items": {
"type": "string"
}
},
"volumes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"container": {
"type": "string"
},
"bind": {
"type": "string"
}
},
"required": ["container"]
}
},
"env": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"default": {
"type": "string"
},
"preset": {
"type": "boolean"
}
},
"required": ["name"]
}
},
"command": {
"type": "string"
},
"interactive": {
"type": "boolean"
},
"note": {
"type": "string"
}
},
"required": ["id", "type", "title"]
}
}
},
"required": ["version", "templates"]
}
51 changes: 27 additions & 24 deletions templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,6 @@
"description": "Dokku setup as a container",
"categories": ["PaaS"],
"platform": "linux",
"logo": "",
"image": "dokku/dokku",
"ports": ["22/tcp", "80/tcp", "443/tcp"],
"volumes": [
Expand Down Expand Up @@ -799,7 +798,7 @@
]
},
{
"id": 39,
"id": 38,
"type": 1,
"title": "Floating License Server",
"description": "License Server for Softing edgeConnector products",
Expand All @@ -816,7 +815,7 @@
]
},
{
"id": 43,
"id": 39,
"type": 2,
"title": "Portainer Agent",
"description": "Manage all the resources in your Swarm cluster",
Expand All @@ -830,7 +829,7 @@
}
},
{
"id": 44,
"id": 40,
"type": 2,
"title": "OpenFaaS",
"name": "func",
Expand All @@ -845,7 +844,7 @@
}
},
{
"id": 45,
"id": 41,
"type": 2,
"title": "IronFunctions",
"description": "Open-source serverless computing platform",
Expand All @@ -859,7 +858,7 @@
}
},
{
"id": 46,
"id": 42,
"type": 2,
"title": "CockroachDB",
"description": "CockroachDB cluster",
Expand All @@ -873,7 +872,7 @@
}
},
{
"id": 47,
"id": 43,
"type": 2,
"title": "WordPress",
"description": "WordPress setup with a MySQL database",
Expand All @@ -894,7 +893,7 @@
]
},
{
"id": 48,
"id": 44,
"type": 3,
"title": "WordPress",
"description": "WordPress setup with a MySQL database",
Expand All @@ -915,7 +914,7 @@
]
},
{
"id": 49,
"id": 46,
"type": 3,
"title": "OpenAMT",
"description": "OpenAMT Cloud Toolkit",
Expand Down Expand Up @@ -962,7 +961,7 @@
]
},
{
"id": 50,
"id": 47,
"type": 2,
"title": "Microsoft OMS Agent",
"description": "Microsoft Operations Management Suite Linux agent.",
Expand All @@ -987,7 +986,7 @@
]
},
{
"id": 51,
"id": 48,
"title": "Sematext Docker Agent",
"type": 2,
"categories": ["Log Management", "Monitoring"],
Expand All @@ -1010,7 +1009,7 @@
]
},
{
"id": 52,
"id": 49,
"title": "Datadog agent",
"type": 2,
"categories": ["Monitoring"],
Expand All @@ -1029,7 +1028,7 @@
]
},
{
"id": 53,
"id": 50,
"type": 3,
"title": "FDO",
"description": "FDO",
Expand All @@ -1051,13 +1050,12 @@
]
},
{
"id": 54,
"id": 51,
"type": 3,
"title": "Dokku",
"description": "Dokku setup as a compose file",
"categories": ["PaaS"],
"platform": "linux",
"logo": "",
"repository": {
"url": "https://github.com/portainer/templates",
"stackfile": "stacks/dokku/docker-compose.yml"
Expand Down Expand Up @@ -1107,7 +1105,7 @@
]
},
{
"id": 55,
"id": 52,
"type": 2,
"title": "LiveSwitch",
"description": "A basic LiveSwitch stack with gateway, caching, database and media server",
Expand All @@ -1126,7 +1124,7 @@
]
},
{
"id": 56,
"id": 53,
"type": 3,
"title": "LiveSwitch",
"description": "A basic LiveSwitch compose with gateway, caching, database and media server",
Expand All @@ -1145,7 +1143,7 @@
]
},
{
"id": 57,
"id": 54,
"type": 3,
"title": "TOSIBOX Lock for Container",
"description": "Lock for Container brings secure connectivity inside your industrial IoT devices",
Expand All @@ -1164,7 +1162,7 @@
]
},
{
"id": 58,
"id": 55,
"type": 3,
"categories": ["edge"],
"title": "Softing EdgeConnector modbus",
Expand All @@ -1176,7 +1174,7 @@
}
},
{
"id": 59,
"id": 56,
"type": 3,
"categories": ["edge"],
"title": "Softing EdgeConnector 840D",
Expand All @@ -1187,7 +1185,7 @@
}
},
{
"id": 60,
"id": 57,
"type": 3,
"categories": ["edge"],
"title": "Softing EdgeConnector Siemens",
Expand All @@ -1198,7 +1196,9 @@
}
},
{
"type": 4,
"id": 58,
"type": 3,
"categories": ["edge"],
"title": "Softing EdgeConnector FANUC CNC",
"description": "Connect FANUC CNCs and provide the data via OPC UA and MQTT",
"repository": {
Expand All @@ -1213,7 +1213,9 @@
]
},
{
"type": 4,
"id": 59,
"type": 3,
"categories": ["edge"],
"title": "Softing EdgeConnector Aggregator",
"description": "Offers a powerful OPC UA aggregation service which provides data via OPC UA, as well as MQTT",
"repository": {
Expand All @@ -1228,7 +1230,7 @@
]
},
{
"id": 61,
"id": 60,
"type": 3,
"categories": ["edge"],
"title": "OPC Router",
Expand Down Expand Up @@ -1261,6 +1263,7 @@
]
},
{
"id": 61,
"type": 3,
"title": "Pro Mosquitto with Management Center",
"description": "Commercial-grade Mosquitto MQTT broker with Management Center",
Expand Down

0 comments on commit 9603167

Please sign in to comment.