Skip to content

Commit eaca84f

Browse files
authored
Merge pull request #29 from Siddhi-sahu/feat/academy-update
[CI] Add `academy-update` make target to invoke hugo mod get -u
2 parents d182de8 + 4bf6acf commit eaca84f

File tree

8 files changed

+21101
-28
lines changed

8 files changed

+21101
-28
lines changed
Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
.DEFAULT_GOAL := show-help
22
# See <https://gist.github.com/klmr/575726c7e05d8780505a> for explanation.
3+
# Modified to support multi-line comments and preserve target order
34
.PHONY: show-help
45
show-help:
5-
@echo "$$(tput bold)Please specify a build target. The choices are:$$(tput sgr0)";echo;sed -ne"/^## /{h;s/.*//;:d" -e"H;n;s/^## //;td" -e"s/:.*//;G;s/\\n## /---/;s/\\n/ /g;p;}" ${MAKEFILE_LIST}|LC_ALL='C' sort -f|awk -F --- -v n=$$(tput cols) -v i=19 -v a="$$(tput setaf 6)" -v z="$$(tput sgr0)" '{printf"%s%*s%s ",a,-i,$$1,z;m=split($$2,w," ");l=n-i;for(j=1;j<=m;j++){l-=length(w[j])+1;if(l<= 0){l=n-i-length(w[j])-1;printf"\n%*s ",-i," ";}printf"%s ",w[j];}printf"\n";}'|more $(shell test $(shell uname) == Darwin && echo '-Xr')
6+
@echo "$$(tput bold)Please specify a build target. The choices are:$$(tput sgr0)";echo; \
7+
awk ' \
8+
/^##/ { \
9+
gsub(/^## ?/, ""); \
10+
if (buffer == "") buffer = $$0; \
11+
else buffer = buffer " " $$0; \
12+
next; \
13+
} \
14+
/^[a-zA-Z_-]+:/ && $$0 !~ /:=/ && $$0 !~ /^\\./ { \
15+
split($$0, parts, ":"); \
16+
target = parts[1]; \
17+
if (target != "" && target !~ /^\./ && !(target in seen)) { \
18+
if (buffer != "") { \
19+
targets[++count] = target; \
20+
comments[target] = buffer; \
21+
seen[target] = 1; \
22+
} \
23+
buffer = ""; \
24+
} \
25+
} \
26+
!/^##/ && !/^[a-zA-Z_-]+:/ { \
27+
buffer = ""; \
28+
} \
29+
END { \
30+
for (i = 1; i <= count; i++) { \
31+
target = targets[i]; \
32+
comment = comments[target]; \
33+
printf "\033[36m%-19s\033[0m %s\n", target, comment; \
34+
} \
35+
}' ${MAKEFILE_LIST}

.github/build/Makefile.core.mk

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ EXOSCALE_DEV="https://dev-sks.exoscale.com"
5454
#-----------------------------------------------------------------------------
5555
# Server
5656
#-----------------------------------------------------------------------------
57-
MESHERY_K8S_SKIP_COMP_GEN ?= TRUE
58-
APPLICATIONCONFIGPATH="./apps.json"
59-
PORT:=9081
57+
PORT:=1313
6058

6159
#-----------------------------------------------------------------------------
6260
# Build

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
fi
5151
5252
echo "✅ Found module for orgId '$ORG_ID': $MODULE"
53-
make update-module module="$MODULE" version="$VERSION"
53+
make theme-update module="$MODULE" version="$VERSION"
5454
5555
- name: Install dependencies
5656
run: make setup

Makefile

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,40 +18,47 @@ include .github/build/Makefile-show-help.mk
1818
#----------------------------------------------------------------------------
1919
# Academy
2020
# ---------------------------------------------------------------------------
21-
.PHONY: setup academy-dev staging-build prod-build update-module
21+
.PHONY: setup build stg-build prod-build theme-update sync-with-cloud site
2222

23-
## Install site dependencies
23+
## ------------------------------------------------------------
24+
----LOCAL_BUILDS: Show help for available targets
25+
26+
## Local: Install site dependencies
2427
setup:
2528
npm i
2629

30+
## Local: Build site for local consumption
31+
build:
32+
hugo build
33+
34+
## Local: Build and run site locally
35+
site:
36+
hugo serve
37+
38+
## ------------------------------------------------------------
39+
----REMOTE_BUILDS: Show help for available targets
40+
41+
## Build site using Layer5 Cloud Staging as the baseURL
42+
stg-build:
43+
hugo --cleanDestinationDir --gc --minify --baseURL "https://staging-cloud.layer5.io/academy"
44+
2745
## Build site using Layer5 Cloud as the baseURL
2846
prod-build:
2947
hugo --cleanDestinationDir --gc --minify --baseURL "https://cloud.layer5.io/academy"
3048

31-
## Build site using Layer5 Cloud Staging as the baseURL
32-
staging-build:
33-
hugo --cleanDestinationDir --gc --minify --baseURL "https://staging-cloud.layer5.io/academy"
3449

35-
## Build site for local consumption
36-
academy-dev:
37-
hugo build
50+
## ------------------------------------------------------------
51+
----MAINTENANCE: Show help for available targets
3852

39-
## Build and run site locally
40-
site:
41-
hugo serve
53+
## Update the academy-theme package to latest version
54+
theme-update:
55+
echo "Updating to latest academy-theme..." && \
56+
hugo mod get -u
4257

43-
## Upgrade site's theme to latest version
44-
## Change to "theme-upgrade"
45-
update-module:
46-
@if [ -z "$(module)" ] || [ -z "$(version)" ]; then \
47-
echo "Usage: make update-module module=<module-path> version=<version>"; \
48-
exit 1; \
49-
fi && \
50-
echo "Updating Hugo module: $(module) to version $(version)" && \
51-
hugo mod get $(module)@$(version)
52-
53-
## Publish Academy build to Layer5 Cloud
58+
## Publish Academy build to Layer5 Cloud.
59+
## Copy built site from public/ to
60+
## ../meshery-cloud/academy directory
5461
sync-with-cloud:
5562
rm -rf ../meshery-cloud/academy
5663
mkdir -p ../meshery-cloud/academy
57-
rsync -av --delete public/ ../meshery-cloud/academy/
64+
rsync -av --delete public/ ../meshery-cloud/academy/

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ go 1.24.5
44

55
require (
66
github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3 // indirect
7+
github.com/google/docsy v0.12.0 // indirect
78
github.com/layer5io/academy-theme v0.1.19 // indirect
89
github.com/layer5io/exoscale-academy v0.3.7 // indirect
910
github.com/layer5io/layer5-academy v0.1.10 // indirect

go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3 h1:/iluJk
22
github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
33
github.com/FortAwesome/Font-Awesome v4.7.0+incompatible h1:3trjm7NtX5NXlju1AxSWSzedDMq2hsfH78Qtqrc8EgY=
44
github.com/FortAwesome/Font-Awesome v4.7.0+incompatible/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
5+
github.com/google/docsy v0.12.0 h1:CddZKL39YyJzawr8GTVaakvcUTCJRAAYdz7W0qfZ2P4=
56
github.com/google/docsy v0.12.0/go.mod h1:1bioDqA493neyFesaTvQ9reV0V2vYy+xUAnlnz7+miM=
67
github.com/layer5io/academy-theme v0.1.15/go.mod h1:kAidN16xIX6Dx2TBz7y0u3DeU8UnfUcoQZ/rVogXN80=
78
github.com/layer5io/academy-theme v0.1.19 h1:X2BiWBGRi83lzQkXfz1DNKF5bgrxmj1raZYSxebB84Q=

0 commit comments

Comments
 (0)