diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..411c95d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +.dockerignore +.flake8 +.git +.github +.gitignore +.yamllint +Dockerfile +LICENSE diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..80af758 --- /dev/null +++ b/.flake8 @@ -0,0 +1,5 @@ +[flake8] +exclude = .git, __pycache__ +ignore = + E501 # line too long + W503 # Line break occurred before a binary operator diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..bfbfd1e --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,24 @@ +--- +updates: +- assignees: + - andrewcole + directory: / + open-pull-requests-limit: 10 + package-ecosystem: docker + schedule: + interval: daily +- assignees: + - andrewcole + directory: / + open-pull-requests-limit: 10 + package-ecosystem: github-actions + schedule: + interval: daily +- assignees: + - andrewcole + directory: / + open-pull-requests-limit: 10 + package-ecosystem: pip + schedule: + interval: daily +version: 2 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..e827ce9 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,54 @@ +--- +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: "0" + - env: + DEFAULT_BUMP: patch + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WITH_V: true + id: version + name: Bump version and push tag + uses: anothrNick/github-tag-action@1.51.0 + - id: meta + name: Docker meta + uses: docker/metadata-action@v4 + with: + flavor: prefix=v,onlatest=false + images: ghcr.io/${{ github.repository }} + tags: type=semver,pattern={{version}},value=${{ steps.version.outputs.new_tag }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + password: ${{ secrets.GITHUB_TOKEN }} + registry: ghcr.io + username: ${{ github.repository_owner }} + - name: Build and push + uses: docker/build-push-action@v3 + with: + cache-from: type=gha + cache-to: type=gha,mode=max + context: . + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + - env: + GITHUB_REPOSITORY: ${{ github.repository }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + name: Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ steps.version.outputs.new_tag }} +name: Release +on: + push: + branches: + - master diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..4a2f56c --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,61 @@ +--- +jobs: + lint-actions: # https://github.com/reviewdog/action-actionlint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: reviewdog/action-actionlint@v1 + with: + fail_on_error: "true" + filter_mode: nofilter + - uses: reviewdog/action-suggester@v1 + lint-dockerfile: # https://github.com/reviewdog/action-hadolint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: reviewdog/action-hadolint@v1 + with: + fail_on_error: "true" + filter_mode: nofilter + - uses: reviewdog/action-suggester@v1 + lint-spelling: # https://github.com/reviewdog/action-misspell + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: reviewdog/action-misspell@v1 + with: + exclude: | + */*.min.css + */*.svg + fail_on_error: "true" + filter_mode: nofilter + - uses: reviewdog/action-suggester@v1 + lint-yaml: # https://github.com/reviewdog/action-yamllint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: reviewdog/action-yamllint@v1 + with: + fail_on_error: "true" + filter_mode: nofilter + - uses: reviewdog/action-suggester@v1 + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: "0" + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Build + uses: docker/build-push-action@v3 + with: + cache-from: type=gha + cache-to: type=gha,mode=max + context: . + platforms: linux/amd64,linux/arm64 + push: false +name: Test +on: pull_request diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a13e71c --- /dev/null +++ b/.gitignore @@ -0,0 +1,140 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ +debug/ diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..e398056 --- /dev/null +++ b/.yamllint @@ -0,0 +1,55 @@ +--- +extends: default +rules: + braces: + forbid: non-empty + brackets: + forbid: non-empty + colons: + max-spaces-after: 1 + max-spaces-before: 0 + commas: + max-spaces-after: 1 + max-spaces-before: 0 + min-spaces-after: 1 + comments: + ignore-shebangs: true + min-spaces-from-content: 2 + require-starting-space: true + comments-indentation: {} + document-end: + present: false + document-start: + present: true + empty-lines: + max: 0 + empty-values: + forbid-in-block-mappings: true + forbid-in-flow-mappings: true + hyphens: + max-spaces-after: 1 + indentation: + check-multi-line-strings: false + indent-sequences: false + spaces: 2 + key-duplicates: {} + key-ordering: {} + line-length: + max: 160 + new-line-at-end-of-file: {} + new-lines: + type: unix + octal-values: + forbid-explicit-octal: true + forbid-implicit-octal: true + quoted-strings: + extra-allowed: [] + extra-required: [] + quote-type: double + required: only-when-needed + trailing-spaces: {} + truthy: + allowed-values: + - "true" + - "false" + check-keys: false diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..da8d76d --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Andrew Cole + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 6dd1f04..96f034c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ -# 🤖 [Telegraf UptimeRobot](https://github.com/illallangi/telegraf-uptimerobot) +# 🧦 [Telegraf Stockdata](https://github.com/illallangi/telegraf-stockdata) -Inspired by [uptime-robot.py](https://github.com/bentasker/telegraf-plugins/blame/master/uptime-robot/uptime-robot.py) +TODO: SET DESCRIPTION + +## Installation + +TODO: DOCUMENT INSTALLATION + +## Usage + +TODO: DOCUMENT USAGE