diff --git a/.ci.run b/.ci.run new file mode 100644 index 0000000..1d78b3b --- /dev/null +++ b/.ci.run @@ -0,0 +1,14 @@ +#!/usr/bin/env sh +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errexit ## set -e : exit the script if any statement returns a non-true return value +set -o xtrace ## set -x : Print command traces before executing command + +# prepare python dependencies +pipenv install >/dev/null + +# build HTML file +pipenv run ./build.py items.yml + +# push into archive +tar czf "$ARCHIVE/portal.tar.gz" -C dist . + diff --git a/.gitignore b/.gitignore index 333813a..0a6f9d1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -/public/ -/.idea \ No newline at end of file +/dist/ +/.idea diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..843724d --- /dev/null +++ b/Pipfile @@ -0,0 +1,8 @@ +[[source]] +name = "pypi" +url = "https://pypi.org/simple" +verify_ssl = true + +[packages] +"ruamel.yaml" = "*" + diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..d155a2c --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,64 @@ +{ + "_meta": { + "hash": { + "sha256": "2f0f3394919b3e7f8bb2996bdd6fdc85294bd6333cb926087b841ce630181fce" + }, + "pipfile-spec": 6, + "requires": {}, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "ruamel.yaml": { + "hashes": [ + "sha256:012b9470a0ea06e4e44e99e7920277edf6b46eee0232a04487ea73a7386340a5", + "sha256:076cc0bc34f1966d920a49f18b52b6ad559fbe656a0748e3535cf7b3f29ebf9e" + ], + "index": "pypi", + "version": "==0.16.12" + }, + "ruamel.yaml.clib": { + "hashes": [ + "sha256:058a1cc3df2a8aecc12f983a48bda99315cebf55a3b3a5463e37bb599b05727b", + "sha256:1236df55e0f73cd138c0eca074ee086136c3f16a97c2ac719032c050f7e0622f", + "sha256:1f8c0a4577c0e6c99d208de5c4d3fd8aceed9574bb154d7a2b21c16bb924154c", + "sha256:2602e91bd5c1b874d6f93d3086f9830f3e907c543c7672cf293a97c3fabdcd91", + "sha256:28116f204103cb3a108dfd37668f20abe6e3cafd0d3fd40dba126c732457b3cc", + "sha256:2d24bd98af676f4990c4d715bcdc2a60b19c56a3fb3a763164d2d8ca0e806ba7", + "sha256:2fd336a5c6415c82e2deb40d08c222087febe0aebe520f4d21910629018ab0f3", + "sha256:30dca9bbcbb1cc858717438218d11eafb78666759e5094dd767468c0d577a7e7", + "sha256:44c7b0498c39f27795224438f1a6be6c5352f82cb887bc33d962c3a3acc00df6", + "sha256:464e66a04e740d754170be5e740657a3b3b6d2bcc567f0c3437879a6e6087ff6", + "sha256:46d6d20815064e8bb023ea8628cfb7402c0f0e83de2c2227a88097e239a7dffd", + "sha256:4df5019e7783d14b79217ad9c56edf1ba7485d614ad5a385d1b3c768635c81c0", + "sha256:4e52c96ca66de04be42ea2278012a2342d89f5e82b4512fb6fb7134e377e2e62", + "sha256:5254af7d8bdf4d5484c089f929cb7f5bafa59b4f01d4f48adda4be41e6d29f99", + "sha256:52ae5739e4b5d6317b52f5b040b1b6639e8af68a5b8fd606a8b08658fbd0cab5", + "sha256:53b9dd1abd70e257a6e32f934ebc482dac5edb8c93e23deb663eac724c30b026", + "sha256:6c0a5dc52fc74eb87c67374a4e554d4761fd42a4d01390b7e868b30d21f4b8bb", + "sha256:73b3d43e04cc4b228fa6fa5d796409ece6fcb53a6c270eb2048109cbcbc3b9c2", + "sha256:74161d827407f4db9072011adcfb825b5258a5ccb3d2cd518dd6c9edea9e30f1", + "sha256:75f0ee6839532e52a3a53f80ce64925ed4aed697dd3fa890c4c918f3304bd4f4", + "sha256:839dd72545ef7ba78fd2aa1a5dd07b33696adf3e68fae7f31327161c1093001b", + "sha256:8be05be57dc5c7b4a0b24edcaa2f7275866d9c907725226cdde46da09367d923", + "sha256:8e8fd0a22c9d92af3a34f91e8a2594eeb35cba90ab643c5e0e643567dc8be43e", + "sha256:a873e4d4954f865dcb60bdc4914af7eaae48fb56b60ed6daa1d6251c72f5337c", + "sha256:ab845f1f51f7eb750a78937be9f79baea4a42c7960f5a94dde34e69f3cce1988", + "sha256:b1e981fe1aff1fd11627f531524826a4dcc1f26c726235a52fcb62ded27d150f", + "sha256:b4b0d31f2052b3f9f9b5327024dc629a253a83d8649d4734ca7f35b60ec3e9e5", + "sha256:c6ac7e45367b1317e56f1461719c853fd6825226f45b835df7436bb04031fd8a", + "sha256:daf21aa33ee9b351f66deed30a3d450ab55c14242cfdfcd377798e2c0d25c9f1", + "sha256:e9f7d1d8c26a6a12c23421061f9022bb62704e38211fe375c645485f38df34a2", + "sha256:f6061a31880c1ed6b6ce341215336e2f3d0c1deccd84957b6fa8ca474b41e89f" + ], + "markers": "platform_python_implementation == 'CPython' and python_version < '3.9'", + "version": "==0.2.2" + } + }, + "develop": {} +} diff --git a/build+deploy.sh b/build+deploy.sh index 144a935..ea59c9b 100755 --- a/build+deploy.sh +++ b/build+deploy.sh @@ -5,13 +5,13 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true #set -o xtrace ## set -x : Print command traces before executing command # clean up -rm -rf public +rm -rf dist # build -python3 build.py items.yml +./build.py items.yml # deploy -rsync -v --archive --delete public/ \ +rsync -v --archive --delete dist/ \ ecg00-portal@ecg00.hostsharing.net:doms/my.ecogood.org/htdocs-ssl/ echo diff --git a/build.py b/build.py index e5672a5..26641a8 100755 --- a/build.py +++ b/build.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + import codecs import os from distutils.dir_util import copy_tree @@ -9,7 +11,7 @@ from ruamel.yaml import YAML __location__ = os.path.realpath(os.path.dirname(__file__)) static_folder = os.path.join(__location__, 'static') content_folder = os.path.join(__location__, 'content') -output_folder = os.path.join(__location__, 'public') +output_folder = os.path.join(__location__, 'dist') config_file = sys.argv[1]