From 078e42d8f81400a06d19ed26698921bb521b593a Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Mon, 8 Jun 2020 15:01:23 -0400 Subject: [PATCH 1/3] Add automated tests --- .github/workflows/tests.yml | 13 +++++++++++++ .gitignore | 2 ++ package.json | 20 ++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 .github/workflows/tests.yml create mode 100644 .gitignore create mode 100644 package.json diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..6bbbbac --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,13 @@ +name: tests +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: '14.x' + - run: npm install + - run: npm test diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d502512 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/node_modules +/package-lock.json diff --git a/package.json b/package.json new file mode 100644 index 0000000..4b4e7a8 --- /dev/null +++ b/package.json @@ -0,0 +1,20 @@ +{ + "name": "selfhosted_templates", + "version": "1.0.0", + "description": "Portainer Templates for Selfhosted Projects/Homelabs.", + "private": true, + "devDependencies": { + "valid-json-cli": "^1.4.1", + "yaml-validator": "^3.0.0" + }, + "scripts": { + "pretest": "validjson Template/template.json", + "test": "yaml-validator Template/Stack/*" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/SelfhostedPro/selfhosted_templates.git" + }, + "author": "Qballjos", + "license": "GPLv3" +} From d01782e1de7e2a63e3f7e7be5b1fb6f1996aa160 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Mon, 8 Jun 2020 15:02:45 -0400 Subject: [PATCH 2/3] Fix end of files --- Template/Stack/bookstack.yml | 2 +- Template/template.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Template/Stack/bookstack.yml b/Template/Stack/bookstack.yml index a44f27d..d4c54db 100644 --- a/Template/Stack/bookstack.yml +++ b/Template/Stack/bookstack.yml @@ -31,4 +31,4 @@ services: - MYSQL_PASSWORD=${DATABASE_PASSWORD} volumes: - /portainer/Files/AppData/Bookstack/DB:/config - restart: unless-stopped \ No newline at end of file + restart: unless-stopped diff --git a/Template/template.json b/Template/template.json index d74a298..6a4f805 100644 --- a/Template/template.json +++ b/Template/template.json @@ -3526,4 +3526,4 @@ } ] } -] \ No newline at end of file +] From 5013c7e1172f7b8aae4c07ff401bdf576379d44f Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Mon, 8 Jun 2020 15:10:30 -0400 Subject: [PATCH 3/3] Use jsonlint --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4b4e7a8..fafbcc9 100644 --- a/package.json +++ b/package.json @@ -4,11 +4,11 @@ "description": "Portainer Templates for Selfhosted Projects/Homelabs.", "private": true, "devDependencies": { - "valid-json-cli": "^1.4.1", + "jsonlint": "^1.6.3", "yaml-validator": "^3.0.0" }, "scripts": { - "pretest": "validjson Template/template.json", + "pretest": "jsonlint Template/template.json --quiet", "test": "yaml-validator Template/Stack/*" }, "repository": {