-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* made it build * Added Dockerfile and surrounding things * Update inotify_script.sh * forgot a bracket * Cron Folder was wrong, added some protection for sim processing * added logging and fixed a script typo * added docker builder * autopep8 action fixes * Added Tests back in, and audio file (#27) * Added Tests back in, and audio file * autopep8 action fixes * changed test code * autopep8 action fixes * run, not command Co-authored-by: Emersont1 <[email protected]> * moved to bash for a painless redirect * Removed egg-info fixed #25 (comment) * Added to poetry file * autopep8 action fixes (#30) Co-authored-by: Emersont1 <[email protected]> Co-authored-by: Emersont1 <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
a6c5e9d
commit 99bf7ee
Showing
27 changed files
with
369 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: ci | ||
|
||
on: | ||
schedule: | ||
- cron: '0 10 * * *' # everyday at 10am | ||
push: | ||
branches: | ||
- '**' | ||
tags: | ||
- 'v*.*.*' | ||
pull_request: | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
- | ||
name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
# list of Docker images to use as base name for tags | ||
images: | | ||
ghcr.io/urn/hstp | ||
# generate Docker tags based on the following events/attributes | ||
tags: | | ||
type=schedule | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
type=sha | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- | ||
name: Login to GHCR | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.GH_USERNAME }} | ||
password: ${{ secrets.GH_TOKEN }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
venv | ||
__pycache__ | ||
__ignore__ | ||
__ignore__ | ||
build | ||
dist | ||
*.egg-info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM python:3.8-alpine | ||
|
||
RUN apk add inotify-tools bash | ||
|
||
COPY /docker/cron_script.sh /docker/inotify_script.sh /bin/ | ||
COPY /docker/build.crontab /etc/crontabs/root | ||
|
||
COPY . /build | ||
|
||
RUN pip install /build | ||
|
||
CMD ["/bin/inotify_script.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: '3.0' | ||
services: | ||
build-files: | ||
build: . | ||
volumes: | ||
- ./input:/input | ||
- ./out:/output | ||
- ./log:/log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*/10 * * * * /bin/cron_script.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#! /bin/bash | ||
|
||
if [ -e /changed ]; then | ||
timeSinceMod=$(($(date +%s) - $(date +%s -r /changed))) | ||
if [ $timeSinceMod -gt 600 ]; then | ||
if [ ! -e /active ]; then | ||
touch /active | ||
date >> /log | ||
python -m hstp -i /input -o /output &>> /log | ||
rm /changed /active | ||
fi | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#! /bin/sh | ||
|
||
crond | ||
|
||
inotifywait -m /input -r | | ||
while read directory action file; do | ||
touch /changed | ||
done |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[tool.poetry] | ||
name = "hstp" | ||
version = "2.0.0" | ||
description = "hstp build" | ||
authors = ["University Radio Nottingham <[email protected]>"] | ||
license = "MIT" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.8" | ||
lxml = "4.6.4" | ||
mutagen = "1.45.1" | ||
pep8 = "1.7.1" | ||
pycodestyle = "2.7.0" | ||
python-dateutil = "2.8.2" | ||
simple-colors = "0.1.5" | ||
|
||
[tool.poetry.dev-dependencies] | ||
|
||
[build-system] | ||
requires = ["poetry-core>=1.0.0"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.poetry.plugins."console_scripts"] | ||
"hstp" = "hstp.__main__:main" | ||
"audioboom-download" = "audioboom.downloader.__main__:main" |
Oops, something went wrong.