Skip to content

Commit

Permalink
Merge pull request #194 from J-A-A-M/develop
Browse files Browse the repository at this point in the history
3.9
  • Loading branch information
v00g100skr authored Apr 5, 2024
2 parents db8049c + 9db5f7d commit 14793b9
Show file tree
Hide file tree
Showing 72 changed files with 2,660 additions and 1,551 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/beta_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ jobs:
with:
beta_binary_path: ${{ github.workspace }}/JAAM_${{ env.BETA_VERSION }}.bin
version: ${{ inputs.release-version }}
beta_build: ${{ github.run_number }}
beta_build: ${{ github.run_number }}
- name: Commit changes
id: commit_changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Beta ${{ env.BETA_VERSION }}"
file_pattern: ${{ github.workspace }}/bin_beta/ ${{ github.workspace }}/pages/
file_pattern: ${{ github.workspace }}/bin_beta/ ${{ github.workspace }}/flasher/
- name: Create Beta Pre Release
uses: ncipollo/release-action@v1
with:
Expand All @@ -61,7 +61,7 @@ jobs:
generateReleaseNotes: true
allowUpdates: true
prerelease: true
makeLatest: false
makeLatest: false
- name: Update server test bin list
uses: appleboy/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clone_count.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: GitHub Clone Count Update Everyday

on:
schedule:
- cron: "0 */24 * * *"
- cron: "0 0 */1 * *"
workflow_dispatch:

jobs:
Expand Down
21 changes: 18 additions & 3 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
types: [ opened, synchronize, reopened ]
branches:
- develop
push:
branches:
- develop
workflow_dispatch:
env:
SKETCHES_REPORTS_PATH: sketches-reports
Expand Down Expand Up @@ -85,3 +82,21 @@
with:
name: lint-report
path: ${{ github.workspace }}/lint-report.json
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Setup uncompromising Python code formatter
run: |
python -m pip install black==24.3.0
- name: Run Black in the check mode (and ignore output)
run: |
black --check --verbose --line-length 120 --target-version py312 deploy
check_flasher:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check flasher with proof-html
uses: anishathalye/proof-html@v2
with:
directory: ${{ github.workspace }}/flasher
38 changes: 23 additions & 15 deletions .github/workflows/deploy_server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ on:
type: boolean
default: false
description: SVG Generator
redeploy_explosions:
redeploy_etryvoga:
type: boolean
default: false
description: Explosions
description: Etryvoga

run-name: Deploy Microservices from '${{ github.ref_name }}' branch
jobs:
Expand All @@ -58,7 +58,7 @@ jobs:
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git checkout ${{ github.ref_name }}
git switch ${{ github.ref_name }}
git pull
bash redeploy_tcp_server.sh -m ${{ secrets.MEMCACHED_HOST }}
- name: Redeploy WebSockets
Expand All @@ -71,9 +71,9 @@ jobs:
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git checkout ${{ github.ref_name }}
git switch ${{ github.ref_name }}
git pull
bash redeploy_websocket_server.sh -m ${{ secrets.MEMCACHED_HOST }}
bash redeploy_websocket_server.sh -m ${{ secrets.MEMCACHED_HOST }} -s ${{ secrets.API_SECRET }} -i ${{ secrets.MEASUREMENT_ID }}
- name: Redeploy Update Server (bin list)
if: ${{ inputs.redeploy_update_server || inputs.redeploy_all }}
uses: appleboy/[email protected]
Expand All @@ -84,7 +84,7 @@ jobs:
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git checkout ${{ github.ref_name }}
git switch ${{ github.ref_name }}
git pull
bash redeploy_update_server.sh -s '/root/ukraine_alarm_map/bin' -sb '/root/ukraine_alarm_map/bin_beta' -m ${{ secrets.MEMCACHED_HOST }}
- name: Redeploy Web Server
Expand All @@ -97,7 +97,7 @@ jobs:
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git checkout ${{ github.ref_name }}
git switch ${{ github.ref_name }}
git pull
bash redeploy_web_server.sh -d ${{ secrets.WEB_TOKEN }} -p 80 -m ${{ secrets.MEMCACHED_HOST }}
- name: Redeploy Weather
Expand All @@ -110,7 +110,7 @@ jobs:
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git checkout ${{ github.ref_name }}
git switch ${{ github.ref_name }}
git pull
bash redeploy_weather.sh -w ${{ secrets.WEATHER_TOKEN }} -m ${{ secrets.MEMCACHED_HOST }}
- name: Redeploy Updater
Expand All @@ -123,7 +123,7 @@ jobs:
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git checkout ${{ github.ref_name }}
git switch ${{ github.ref_name }}
git pull
bash redeploy_updater.sh -m ${{ secrets.MEMCACHED_HOST }}
- name: Redeploy Svg Generator
Expand All @@ -136,11 +136,11 @@ jobs:
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git checkout ${{ github.ref_name }}
git switch ${{ github.ref_name }}
git pull
bash redeploy_svg_generator.sh -m ${{ secrets.MEMCACHED_HOST }}
- name: Redeploy Explosions
if: ${{ inputs.redeploy_explosions || inputs.redeploy_all }}
- name: Redeploy Etryvoga
if: ${{ inputs.redeploy_etryvoga || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
Expand All @@ -149,9 +149,9 @@ jobs:
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git checkout ${{ github.ref_name }}
git switch ${{ github.ref_name }}
git pull
bash redeploy_explosions.sh -e ${{ secrets.ETRYVOGA_HOST }} -m ${{ secrets.MEMCACHED_HOST }}
bash redeploy_etryvoga.sh -e ${{ secrets.ETRYVOGA_HOST }} -m ${{ secrets.MEMCACHED_HOST }}
- name: Redeploy Alerts
if: ${{ inputs.redeploy_alerts || inputs.redeploy_all }}
uses: appleboy/[email protected]
Expand All @@ -162,6 +162,14 @@ jobs:
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git checkout ${{ github.ref_name }}
git switch ${{ github.ref_name }}
git pull
bash redeploy_alerts.sh -a ${{ secrets.AIR_ALARM_API_KEY }} -p 2 -m ${{ secrets.MEMCACHED_HOST }}
- name: Clear unused images
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_SSH_USER }}
password: ${{ secrets.SERVER_SSH_PASSWORD }}
script: |
docker image prune -f
18 changes: 14 additions & 4 deletions .github/workflows/deploy_websockets_dev.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
name: 🧪 Deploy Dev Websockets
on: workflow_dispatch
on:
workflow_dispatch:
inputs:
random_mode:
type: boolean
default: false
description: Random Alerst Mode
fetch_interval:
type: number
default: 1
description: Memcached Fetch Interval (seconds)

run-name: Deploy Dev Websockets from '${{ github.ref_name }}' branch
jobs:
deploy_microservices:
deploy_websocket_dev:
runs-on: ubuntu-latest
steps:
- name: Redeploy Dev WebSockets
Expand All @@ -15,6 +25,6 @@ jobs:
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git checkout ${{ github.ref_name }}
git switch ${{ github.ref_name }}
git pull
bash redeploy_websocket_server_dev.sh -m ${{ secrets.MEMCACHED_HOST }} -s ${{ secrets.API_SECRET }} -i ${{ secrets.MEASUREMENT_ID }}
bash redeploy_websocket_server_dev.sh -m ${{ secrets.MEMCACHED_HOST }} -s ${{ secrets.API_SECRET }} -i ${{ secrets.MEASUREMENT_ID }} -r ${{ inputs.random_mode && 'True' || 'False' }} -f ${{ inputs.fetch_interval }}
2 changes: 1 addition & 1 deletion .github/workflows/firmware-compile/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ runs:
- name: NTPTime
version: 1.2.1
- name: NeoPixelBus by Makuna
version: 2.7.8
version: 2.7.9
- name: WiFiManager
version: 2.0.17
- name: arduino-sht
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Release ${{ inputs.release-version }}"
file_pattern: ${{ github.workspace }}/src/firmware/firmware.ino ${{ github.workspace }}/bin/ ${{ github.workspace }}/bin_beta/ ${{ github.workspace }}/pages/
file_pattern: ${{ github.workspace }}/src/firmware/firmware.ino ${{ github.workspace }}/bin/ ${{ github.workspace }}/bin_beta/ ${{ github.workspace }}/flasher/
- name: Create Release
uses: ncipollo/release-action@v1
with:
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/upload-pages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,41 +23,41 @@ runs:
if: ${{ inputs.binary_path != '' }}
shell: bash
run: |
cp -f ${{ inputs.binary_path }} ${{ github.workspace }}/pages/bins/jaam.bin
cp -f ${{ inputs.binary_path }} ${{ github.workspace }}/flasher/bins/jaam.bin
- name: Change version in flasher
if: ${{ inputs.binary_path != '' }}
shell: bash
run: |
sed -i 's/>Встановити JAAM [0-9.]*</>Встановити JAAM ${{ inputs.version }}</' ${{ github.workspace }}/pages/index.html
sed -i 's/"version": ".*",/"version": "${{ inputs.version }}",/' ${{ github.workspace }}/pages/manifest.json
sed -i 's/>Встановити JAAM [0-9.]*</>Встановити JAAM ${{ inputs.version }}</' ${{ github.workspace }}/flasher/index.html
sed -i 's/"version": ".*",/"version": "${{ inputs.version }}",/' ${{ github.workspace }}/flasher/manifest.json
- name: Copy beta bin to flasher
if: ${{ inputs.beta_binary_path != '' }}
shell: bash
run: |
cp -f ${{ inputs.beta_binary_path }} ${{ github.workspace }}/pages/bins/jaam_beta.bin
cp -f ${{ inputs.beta_binary_path }} ${{ github.workspace }}/flasher/bins/jaam_beta.bin
- name: Change beta version in flasher
if: ${{ inputs.beta_binary_path != '' }}
shell: bash
run: |
sed -i 's/>Встановити JAAM [0-9.]* Beta [0-9]*</>Встановити JAAM ${{ inputs.version }} Beta ${{ inputs.beta_build }}</' ${{ github.workspace }}/pages/index.html
sed -i 's/"version": ".*",/"version": "${{ inputs.version }}-b${{ inputs.beta_build }}",/' ${{ github.workspace }}/pages/manifest-beta.json
sed -i 's/>Встановити JAAM [0-9.]* Beta [0-9]*</>Встановити JAAM ${{ inputs.version }} Beta ${{ inputs.beta_build }}</' ${{ github.workspace }}/flasher/index.html
sed -i 's/"version": ".*",/"version": "${{ inputs.version }}-b${{ inputs.beta_build }}",/' ${{ github.workspace }}/flasher/manifest-beta.json
- name: Copy lite bin to flasher
if: ${{ inputs.lite_binary_path != '' }}
shell: bash
run: |
cp -f ${{ inputs.lite_binary_path }} ${{ github.workspace }}/pages/bins/jaam_lite.bin
cp -f ${{ inputs.lite_binary_path }} ${{ github.workspace }}/flasher/bins/jaam_lite.bin
- name: Change lite version in flasher
if: ${{ inputs.lite_binary_path != '' }}
shell: bash
run: |
sed -i 's/>Встановити JAAM [0-9.]* Lite</>Встановити JAAM ${{ inputs.version }} Lite</' ${{ github.workspace }}/pages/index.html
sed -i 's/"version": ".*",/"version": "${{ inputs.version }}",/' ${{ github.workspace }}/pages/manifest-lite.json
sed -i 's/>Встановити JAAM [0-9.]* Lite</>Встановити JAAM ${{ inputs.version }} Lite</' ${{ github.workspace }}/flasher/index.html
sed -i 's/"version": ".*",/"version": "${{ inputs.version }}",/' ${{ github.workspace }}/flasher/manifest-lite.json
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: '${{ github.workspace }}/pages'
path: '${{ github.workspace }}/flasher'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
- режим лампи
- режим offline - мапа не відображає нічого

В режим тривог також є візуальна інформація про вибухи в регіонах

### Для отримання даних не треба мати ключі для API тривог або openweathermap - все вже є в нашому API

Мапа може бути обладнана _**дисплеєм**_ (128 * 32 SSD1306 та 128 * 64 SSD1306).
Expand Down
Binary file renamed bin_beta/3.8-b36.bin → bin_beta/3.9-b51.bin
Binary file not shown.
Binary file renamed bin_beta/3.8.1.bin → bin_beta/3.9-b53.bin
Binary file not shown.
Binary file renamed bin_beta/3.8.1-b39.bin → bin_beta/3.9-b54.bin
Binary file not shown.
Binary file modified bin_beta/latest_beta.bin
Binary file not shown.
8 changes: 4 additions & 4 deletions deploy/alerts/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM python:3.10.6
ADD alerts.py .
ADD requirements.txt .
RUN pip install -r requirements.txt --no-cache-dir && rm -f requirements.txt
FROM python:3.12-slim
COPY alerts.py .
RUN --mount=type=bind,source=requirements.txt,target=/tmp/requirements.txt \
python -m pip install --no-cache-dir -r /tmp/requirements.txt
CMD python alerts.py
Loading

0 comments on commit 14793b9

Please sign in to comment.