Skip to content

Commit ca0065f

Browse files
authored
Merge pull request #138 from layer5io/leecalcote/ci/makefile-overhaul
Leecalcote/ci/makefile-overhaul
2 parents 08c5c7f + c46a293 commit ca0065f

File tree

5 files changed

+68
-16
lines changed

5 files changed

+68
-16
lines changed

.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
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}

Makefile

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,53 @@
11
# Copyright Layer5, Inc.
22
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
3+
# Licensed under the GNU Affero General Public License, Version 3.0
4+
# (the # "License"); you may not use this file except in compliance
5+
# with the License. You may obtain a copy of the License at
66
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
7+
# https://www.gnu.org/licenses/agpl-3.0.en.html
88
#
99
# Unless required by applicable law or agreed to in writing, software
1010
# distributed under the License is distributed on an "AS IS" BASIS,
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
#include .github/build/Makefile.show-help.mk
15+
include .github/build/Makefile.core.mk
16+
include .github/build/Makefile.show-help.mk
1617

17-
## Install academy-example dependencies on your local machine.
18-
## See https://gohugo.io/categories/installation
18+
#----------------------------------------------------------------------------
19+
# Academy
20+
# ---------------------------------------------------------------------------
21+
## Install site dependencies
1922
setup:
2023
npm install
2124

22-
## Run on your local machine with draft and future content enabled.
25+
## Build and run site locally with draft and future content enabled.
2326
site: check-go
2427
hugo server -D -F
2528

29+
## Build site for local consumption
2630
build:
27-
hugo
31+
hugo build
2832

2933
## Empty build cache and run on your local machine.
3034
clean:
3135
hugo --cleanDestinationDir
3236
make site
3337

38+
39+
40+
## ------------------------------------------------------------
41+
----MAINTENANCE: Show help for available targets
42+
3443
check-go:
3544
@echo "Checking if Go is installed..."
3645
@command -v go > /dev/null || (echo "Go is not installed. Please install it before proceeding."; exit 1)
3746
@echo "Go is installed."
3847

39-
## Update academy-theme package to latest version
40-
academy-update:
48+
## Update the academy-theme package to latest version
49+
theme-update:
50+
echo "Updating to latest academy-theme..." && \
4151
hugo mod get -u
4252

43-
.PHONY: setup build site clean site-fast check-go academy-update
53+
.PHONY: setup build site clean site-fast check-go theme-update

go.mod

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
module github.com/layer5io/exoscale-academy
22

33
go 1.24.5
4+
5+
require (
6+
github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3 // indirect
7+
github.com/layer5io/academy-theme v0.1.19 // indirect
8+
github.com/twbs/bootstrap v5.3.7+incompatible // indirect
9+
)

go.sum

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3 h1:/iluJkJiyTAdnqrw3Yi9rH2HNHhrrtCmj8VJe7I6o3w=
2+
github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
3+
github.com/FortAwesome/Font-Awesome v4.7.0+incompatible h1:3trjm7NtX5NXlju1AxSWSzedDMq2hsfH78Qtqrc8EgY=
4+
github.com/FortAwesome/Font-Awesome v4.7.0+incompatible/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
5+
github.com/layer5io/academy-theme v0.1.19 h1:X2BiWBGRi83lzQkXfz1DNKF5bgrxmj1raZYSxebB84Q=
6+
github.com/layer5io/academy-theme v0.1.19/go.mod h1:Dv72UWsREOvX4Zg4mJjrpoyDxdgxxpiDotxqYBXMjXo=
7+
github.com/twbs/bootstrap v5.3.7+incompatible h1:ea1W8TOWZFkqSK2M0McpgzLiUQVru3bz8aHb0j/XtuM=
8+
github.com/twbs/bootstrap v5.3.7+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=

0 commit comments

Comments
 (0)