Skip to content

Commit 2555cc6

Browse files
authored
Merge pull request #69 from layer5io/update-academy-theme-fix
start tracking module version
2 parents 54e4e54 + 206c7bd commit 2555cc6

File tree

3 files changed

+31
-7
lines changed

3 files changed

+31
-7
lines changed

.github/workflows/build-and-release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
run: |
4242
ORG_ID="${{ github.event.inputs.orgId }}"
4343
VERSION="${{ github.event.inputs.version || 'latest' }}"
44-
MODULE=$(jq -r --arg orgId "$ORG_ID" '.orgToModuleMapping[$orgId]' academy_config.json)
44+
MODULE=$(jq -r --arg orgId "$ORG_ID" '.orgToModuleMapping[$orgId].module' academy_config.json)
4545
4646
if [ "$MODULE" = "null" ] || [ -z "$MODULE" ]; then
4747
echo "❌ Module not found for orgId: $ORG_ID"
@@ -50,6 +50,7 @@ jobs:
5050
5151
echo "✅ Found module for orgId '$ORG_ID': $MODULE"
5252
make update-module module="$MODULE" version="$VERSION"
53+
make update-org-to-module-version orgId="$ORG_ID" version="$VERSION"
5354
5455
- name: Install dependencies
5556
run: make setup
@@ -81,6 +82,7 @@ jobs:
8182
rm -rf meshery-cloud/academy
8283
mkdir -p meshery-cloud/academy
8384
rsync -av --delete public/ meshery-cloud/academy/
85+
cp academy_config.json meshery-cloud/academy/
8486
8587
- name: Commit & push academy to meshery-cloud
8688
uses: stefanzweifel/git-auto-commit-action@v5

Makefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ include .github/build/Makefile-show-help.mk
1818
#----------------------------------------------------------------------------
1919
# Academy
2020
# ---------------------------------------------------------------------------
21-
.PHONY: setup build stg-build prod-build theme-update sync-with-cloud site
21+
.PHONY: setup build stg-build prod-build theme-update sync-with-cloud site check-go update-module update-org-to-module-version
2222

2323
## ------------------------------------------------------------
2424
----LOCAL_BUILDS: Show help for available targets
@@ -70,10 +70,22 @@ update-module:
7070
echo "Updating Hugo module: $(module) to version $(version)" && \
7171
hugo mod get $(module)@$(version)
7272

73+
update-org-to-module-version:
74+
@if [ -z "$(orgId)" ] || [ -z "$(version)" ]; then \
75+
echo "Usage: make update-org-to-module-mapping orgId=<org-id> version=<version>"; \
76+
exit 1; \
77+
fi && \
78+
jq --arg orgId "$(orgId)" --arg version "$(version)" \
79+
'.orgToModuleMapping[$$orgId].version = $$version' \
80+
academy_config.json > tmp.json && mv tmp.json academy_config.json
81+
82+
7383
## Publish Academy build to Layer5 Cloud.
7484
## Copy built site from public/ to
7585
## ../meshery-cloud/academy directory
7686
sync-with-cloud:
7787
rm -rf ../meshery-cloud/academy
7888
mkdir -p ../meshery-cloud/academy
79-
rsync -av --delete public/ ../meshery-cloud/academy/
89+
rsync -av --delete public/ ../meshery-cloud/academy/
90+
cp academy_config.json ../meshery-cloud/academy/
91+
@echo "Academy site synced with Layer5 Cloud."

academy_config.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
{
2-
"orgToModuleMapping":{
3-
"27e21312-1e0c-4b2b-a045-95fcde425f09": "github.com/aabidsofi19/aabids-academy",
4-
"98e16360-a366-4b78-8e0a-031da07fdacb" : "github.com/layer5io/exoscale-academy",
5-
"11111111-1111-1111-1111-111111111111": "github.com/layer5io/layer5-academy"
2+
"orgToModuleMapping": {
3+
"27e21312-1e0c-4b2b-a045-95fcde425f09": {
4+
"module": "github.com/aabidsofi19/aabids-academy",
5+
"version": "v1.2"
6+
},
7+
"98e16360-a366-4b78-8e0a-031da07fdacb": {
8+
"module": "github.com/layer5io/exoscale-academy",
9+
"version": "v4.6"
10+
},
11+
"11111111-1111-1111-1111-111111111111": {
12+
"module": "github.com/layer5io/layer5-academy",
13+
"version": "v2.5"
14+
}
15+
616
}
717
}

0 commit comments

Comments
 (0)