Skip to content

Commit

Permalink
Merge pull request #66 from soubinan/features
Browse files Browse the repository at this point in the history
Fixes for Omada template + build mode improvement
  • Loading branch information
soubinan authored Jan 11, 2025
2 parents 69e21bf + d949ba2 commit 44113b0
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 28 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/auto-cleaner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ on:
branches:
- main
paths:
- '.github/auto-cleaner.js'
- '.github/workflows/auto-cleaner.yml'
- ".github/auto-cleaner.js"
- ".github/workflows/auto-cleaner.yml"
schedule:
- cron: '0 0 */3 * *'
- cron: "0 0 */3 * *"

env:
NODE_VERSION: 20.x
Expand Down
24 changes: 20 additions & 4 deletions .github/workflows/trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,29 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4

- name: List templates
id: templates-list
- name: List changed templates
id: all-changed-templates-list
uses: tj-actions/changed-files@v45
with:
files: templates/**
if: ${{github.event_name}} == 'pull_request'

- name: List all templates
id: all-templates-list
run: |
sudo apt-get install -y jq
echo TEMPLATES_LIST="$(ls templates/* | jq -Rsc 'split("\n")[:-1]')" | tee -a $GITHUB_OUTPUT
echo all_files="$(printf '%s' "$(ls templates/*)" | jq -Rsc 'split("\n")')" | tee -a $GITHUB_OUTPUT
echo all_changed_files=$(echo -n ${{ steps.all-changed-templates-list.outputs.all_changed_files }} | jq -Rsc 'split(" ")') | tee -a $GITHUB_OUTPUT
if: ${{github.event_name}} != 'pull_request'

- name: Check templates list
id: check-templates-list
run: |
echo all_files=${{ steps.all-templates-list.outputs.all_files }}
echo all_changed_files=${{ steps.all-templates-list.outputs.all_changed_files }}
echo TEMPLATES_LIST=${{ steps.all-templates-list.outputs.all_changed_files != '[]' && steps.all-templates-list.outputs.all_changed_files || steps.all-templates-list.outputs.all_files }} | tee -a $GITHUB_OUTPUT
outputs:
templates_list: ${{steps.templates-list.outputs.TEMPLATES_LIST}}
templates_list: ${{steps.check-templates-list.outputs.TEMPLATES_LIST}}

image-build:
needs: init
Expand Down
47 changes: 26 additions & 21 deletions templates/omada.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,33 @@ metadata:
- amd64
instructions:
files:
- path: /etc/systemd/system/nodered.service
- path: /tmp/data.json
generator: dump
mode: "0440"
mode: "0777"
content: |-
[Unit]
Description=Node-RED
After=syslog.target network.target
[Service]
ExecStart=/usr/bin/node-red --max-old-space-size=128 -v
Restart=on-failure
KillSignal=SIGINT
SyslogIdentifier=node-red
StandardOutput=syslog
WorkingDirectory=/root/
User=root
Group=root
[Install]
WantedBy=multi-user.target
{
"pageIndex": 0,
"pageSize": 1,
"sortField": "",
"sortOrder": "DESC",
"keyword": ".deb",
"siteId": 1,
"siteCode": "en",
"resourceType": "download",
"typeIdList": [],
"documentResourceTypeIdList": [],
"downloadsResourceTypeIdList": [],
"bulletinsResourceTypeIdList": [],
"documentTagIdList": [],
"downloadTagIdList": [],
"bulletinsTagIdList": [],
"communityCategories": [],
"communityTagNames": [],
"suitableModelList": [
"Omada Software Controller",
"Omada Software Controller V5"
]
}
packages:
- jsvc
Expand All @@ -50,7 +55,7 @@ instructions:
wget -qL https://repo.mongodb.org/apt/debian/dists/buster/mongodb-org/4.4/main/binary-amd64/mongodb-org-server_4.4.29_amd64.deb
apt-get install -fy ./mongodb-org-server*_amd64.deb
wget -qL $(curl -fsSL "https://www.tp-link.com/en/support/download/omada-software-controller/"|grep -io "https.*Omada_SDN_Controller.*linux_x64.deb"|head -n1)
wget -qL $(curl -fsSLX POST --url 'https://support.omadanetworks.com/api/v1/search/tourist/searchResource' -H 'accept: application/json' -H 'content-type: application/json' -d @data.json |jq -r '.result.download.content[].url')
apt-get install -fy ./*Omada_SDN_Controller*.deb
systemctl enable mongod.service

0 comments on commit 44113b0

Please sign in to comment.