Skip to content

Commit

Permalink
Merge pull request #708 from NebraLtd/light-hotspot
Browse files Browse the repository at this point in the history
Merging light-hotspot and switching to full Light Miner (gateway-rs)
  • Loading branch information
MuratUrsavas authored Apr 11, 2023
2 parents 68400fc + e10f44a commit 7a05b56
Show file tree
Hide file tree
Showing 20 changed files with 175 additions and 183 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/push-to-prod-new-fleets-nebraos-cloud-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,38 @@ jobs:
uses: actions/checkout@v3
with:
ref: production

- name: Setup Python Libraries
run: pip install -r requirements.txt

- name: Export short SHA of current commit
run: |
FIRMWARE_SHORT_HASH=$( echo ${GITHUB_SHA:0:7} )
echo "FIRMWARE_SHORT_HASH=$FIRMWARE_SHORT_HASH" >> $GITHUB_ENV
# Get the latest GA release and branch
source <(grep FIRMWARE_VERSION settings.ini)
LATEST_GA=$FIRMWARE_VERSION
GITHUB_BRANCH=$( echo "${{ github.ref }}" | sed 's/refs\/heads\///g' )
echo "timestamp=$(date +'%s')" >> $GITHUB_ENV
echo "day=$(date +'%F')" >> $GITHUB_ENV
echo "LATEST_GA=$LATEST_GA" >> $GITHUB_ENV
echo "GITHUB_BRANCH=$GITHUB_BRANCH" >> $GITHUB_ENV
- name: Random sleep (balena API workaround)
run: sleep $[ ( $RANDOM % 540 ) + 1 ]s

- name: Generate Docker Compose
run: |
repo="helium-${{matrix.variant}}"
echo "REPO=$repo" >> $GITHUB_ENV
echo "Repo: $repo"
FIRMWARE_SHORT_HASH=${{ env.FIRMWARE_SHORT_HASH }}
python gen_docker_compose_by_variant.py ${{matrix.variant}} -o docker-compose.yml
- name: Balena Deploy
uses: nebraltd/[email protected]
with:
Expand All @@ -60,7 +60,7 @@ jobs:
with:
name: docker-compose.yml.${{ env.REPO }}
path: docker-compose.yml

- name: Upload docker-compose.yml to release
uses: svenstaro/upload-release-action@v2
with:
Expand All @@ -70,7 +70,7 @@ jobs:
tag: ${{ env.LATEST_GA }}-${{ env.day }}
overwrite: true
body: "This is helium-miner-software release ${{ env.LATEST_GA }}-${{ env.day }}"

- name: Trigger build action in ${{ env.REPO }} repo
uses: peter-evans/repository-dispatch@v2
with:
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/push-to-prod-new-fleets-nebraos-cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,38 @@ jobs:
uses: actions/checkout@v3
with:
ref: production

- name: Setup Python Libraries
run: pip install -r requirements.txt

- name: Export short SHA of current commit
run: |
FIRMWARE_SHORT_HASH=$( echo ${GITHUB_SHA:0:7} )
echo "FIRMWARE_SHORT_HASH=$FIRMWARE_SHORT_HASH" >> $GITHUB_ENV
# Get the latest GA release and branch
source <(grep FIRMWARE_VERSION settings.ini)
LATEST_GA=$FIRMWARE_VERSION
GITHUB_BRANCH=$( echo "${{ github.ref }}" | sed 's/refs\/heads\///g' )
echo "timestamp=$(date +'%s')" >> $GITHUB_ENV
echo "day=$(date +'%F')" >> $GITHUB_ENV
echo "LATEST_GA=$LATEST_GA" >> $GITHUB_ENV
echo "GITHUB_BRANCH=$GITHUB_BRANCH" >> $GITHUB_ENV
- name: Random sleep (balena API workaround)
run: sleep $[ ( $RANDOM % 540 ) + 1 ]s

- name: Generate Docker Compose
run: |
repo="helium-${{matrix.variant}}"
echo "REPO=$repo" >> $GITHUB_ENV
echo "Repo: $repo"
FIRMWARE_SHORT_HASH=${{ env.FIRMWARE_SHORT_HASH }}
python gen_docker_compose_by_variant.py ${{matrix.variant}} -o docker-compose.yml
- name: Balena Deploy
uses: nebraltd/[email protected]
with:
Expand All @@ -63,7 +63,7 @@ jobs:
with:
name: docker-compose.yml.${{ env.REPO }}
path: docker-compose.yml

- name: Upload docker-compose.yml to release
uses: svenstaro/upload-release-action@v2
with:
Expand All @@ -73,7 +73,7 @@ jobs:
tag: ${{ env.LATEST_GA }}-${{ env.day }}
overwrite: true
body: "This is helium-miner-software release ${{ env.LATEST_GA }}-${{ env.day }}"

- name: Trigger build action in ${{ env.REPO }} repo
uses: peter-evans/repository-dispatch@v2
with:
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/push-to-prod-old-fleets-nebraos-cloud-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: NebraOS Cloud Deploy (Production - old fleets - draft)

on:
workflow_dispatch:

jobs:
build-prod:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -79,34 +79,34 @@ jobs:
uses: actions/checkout@v3
with:
ref: production

- name: Setup Python Libraries
run: pip install -r requirements.txt

- name: Export short SHA of current commit
shell: bash
run: |
FIRMWARE_SHORT_HASH=$( echo ${GITHUB_SHA:0:7} )
echo "FIRMWARE_SHORT_HASH=$FIRMWARE_SHORT_HASH" >> $GITHUB_ENV
# Get the latest GA release and branch
source <(grep FIRMWARE_VERSION settings.ini)
LATEST_GA=$FIRMWARE_VERSION
GITHUB_BRANCH=$( echo "${{ github.ref }}" | sed 's/refs\/heads\///g' )
echo "timestamp=$(date +'%s')" >> $GITHUB_ENV
echo "day=$(date +'%F')" >> $GITHUB_ENV
echo "LATEST_GA=$LATEST_GA" >> $GITHUB_ENV
echo "GITHUB_BRANCH=$GITHUB_BRANCH" >> $GITHUB_ENV
- name: Random sleep (balena API workaround)
run: sleep $[ ( $RANDOM % 540 ) + 1 ]s

- name: Generate Docker Compose
run: |
miner="${{ matrix.sbc }}"
type="${{ matrix.variant }}"
if [[ "$miner" == "raspi" ]] && [[ "$type" == "indoor" ]] ; then
variant="nebra-indoor1"
elif [[ "$miner" == "raspi" ]] && [[ "$type" == "outdoor" ]] ; then
Expand All @@ -120,25 +120,25 @@ jobs:
else
variant="$miner-fl1"
fi
if [[ "$miner" == "rockpi" ]] ; then
ROCKPI="-rockpi"
fi
if [[ "$miner" == "rockpi" ]] || [[ "$miner" == "raspi" ]] ; then
repo="helium-${{ matrix.variant }}-${{ matrix.frequency }}$ROCKPI"
else
repo="helium-$miner"
fi
echo "Variant: $variant"
echo "REPO=$repo" >> $GITHUB_ENV
echo "Repo: $repo"
FIRMWARE_SHORT_HASH=${{ env.FIRMWARE_SHORT_HASH }}
python gen_docker_compose_by_variant.py "$variant" -o docker-compose.yml
- name: Balena Deploy
uses: nebraltd/[email protected]
with:
Expand All @@ -161,7 +161,7 @@ jobs:
tag: ${{ env.LATEST_GA }}-${{ env.day }}
overwrite: true
body: "This is helium-miner-software release ${{ env.LATEST_GA }}-${{ env.day }}"

- name: Trigger build action in ${{ env.REPO }} repo
uses: peter-evans/repository-dispatch@v2
if: matrix.sbc != 'raspi' && matrix.sbc != 'rockpi'
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/push-to-prod-old-fleets-nebraos-cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,34 +82,34 @@ jobs:
uses: actions/checkout@v3
with:
ref: production

- name: Setup Python Libraries
run: pip install -r requirements.txt

- name: Export short SHA of current commit
shell: bash
run: |
FIRMWARE_SHORT_HASH=$( echo ${GITHUB_SHA:0:7} )
echo "FIRMWARE_SHORT_HASH=$FIRMWARE_SHORT_HASH" >> $GITHUB_ENV
# Get the latest GA release and branch
source <(grep FIRMWARE_VERSION settings.ini)
LATEST_GA=$FIRMWARE_VERSION
GITHUB_BRANCH=$( echo "${{ github.ref }}" | sed 's/refs\/heads\///g' )
echo "timestamp=$(date +'%s')" >> $GITHUB_ENV
echo "day=$(date +'%F')" >> $GITHUB_ENV
echo "LATEST_GA=$LATEST_GA" >> $GITHUB_ENV
echo "GITHUB_BRANCH=$GITHUB_BRANCH" >> $GITHUB_ENV
- name: Random sleep (balena API workaround)
run: sleep $[ ( $RANDOM % 540 ) + 1 ]s

- name: Generate Docker Compose
run: |
miner="${{ matrix.sbc }}"
type="${{ matrix.variant }}"
if [[ "$miner" == "raspi" ]] && [[ "$type" == "indoor" ]] ; then
variant="nebra-indoor1"
elif [[ "$miner" == "raspi" ]] && [[ "$type" == "outdoor" ]] ; then
Expand All @@ -123,32 +123,32 @@ jobs:
else
variant="$miner-fl1"
fi
if [[ "$miner" == "rockpi" ]] ; then
ROCKPI="-rockpi"
fi
if [[ "$miner" == "rockpi" ]] || [[ "$miner" == "raspi" ]] ; then
repo="helium-${{ matrix.variant }}-${{ matrix.frequency }}$ROCKPI"
else
repo="helium-$miner"
fi
echo "Variant: $variant"
echo "REPO=$repo" >> $GITHUB_ENV
echo "Repo: $repo"
FIRMWARE_SHORT_HASH=${{ env.FIRMWARE_SHORT_HASH }}
python gen_docker_compose_by_variant.py "$variant" -o docker-compose.yml
- name: Balena Deploy
uses: nebraltd/[email protected]
with:
balena_api_token: ${{secrets.NEBRAOS_CLOUD_TOKEN}}
nebraos_cloud: true
balena_command: "deploy nebraltd/${{ env.REPO }} --debug --nocache --build"

- name: Upload docker-compose.yml artifact
uses: actions/upload-artifact@v3
with:
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/push-to-testnet-nebraos-cloud-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,32 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Python Libraries
run: pip install -r requirements.txt

- name: Export short SHA of current commit
run: |
FIRMWARE_SHORT_HASH=$( echo ${GITHUB_SHA:0:7} )
echo "FIRMWARE_SHORT_HASH=$FIRMWARE_SHORT_HASH" >> $GITHUB_ENV
# Get the latest GA release and branch
source <(grep FIRMWARE_VERSION settings.ini)
LATEST_GA=$FIRMWARE_VERSION
GITHUB_BRANCH=$( echo "${{ github.ref }}" | sed 's/refs\/heads\///g' )
echo "timestamp=$(date +'%s')" >> $GITHUB_ENV
echo "day=$(date +'%F')" >> $GITHUB_ENV
echo "LATEST_GA=$LATEST_GA" >> $GITHUB_ENV
echo "GITHUB_BRANCH=$GITHUB_BRANCH" >> $GITHUB_ENV
- name: Random sleep (balena API workaround)
run: sleep $[ ( $RANDOM % 360 ) + 1 ]s

- name: Generate Docker Compose
run: |
miner="${{ matrix.sbc }}"
if [[ "$miner" == "raspi" ]] ; then
variant="nebra-indoor1"
variant2="nebra-outdoor1"
Expand All @@ -62,17 +62,17 @@ jobs:
repo="helium-$miner"
repo2="None"
fi
echo "Variant: $variant"
echo "REPO=$repo" >> $GITHUB_ENV
echo "Repo: $repo"
echo "REPO2=$repo2" >> $GITHUB_ENV
echo "Repo 2: $repo2"
echo "FLEET=$fleet" >> $GITHUB_ENV
echo "Fleet: $fleet"
FIRMWARE_SHORT_HASH=${{ env.FIRMWARE_SHORT_HASH }}
python gen_docker_compose_by_variant.py "$variant" -o docker-compose.yml
if [[ "$repo2" != "None" ]] ; then
Expand Down
Loading

0 comments on commit 7a05b56

Please sign in to comment.