Skip to content

Commit e80aaf7

Browse files
authored
Release/1.3.0 (#40)
* Implemented scaffolding for BrowserDev tasks and implemented taskGetBrowserDevPassword * Added SetBrowserDevPasswordFile and ReplaceTextInFile funcs * Added browserDevProxyPath * Polished code and added missing pieces * Improved Makefile with info and install + build processes * Added vscode tasks support * Added run command and reverted build-all to old logic, added run vscode task * Added GetBrowserDevStatus task and into schedules * Fixed check for tasks.GetBrowserStatus() * Reverted to no result log in Exec command
1 parent b11034d commit e80aaf7

File tree

7 files changed

+496
-4
lines changed

7 files changed

+496
-4
lines changed

.vscode/tasks.json

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Build",
6+
"type": "shell",
7+
"command": "make",
8+
"args": ["build"],
9+
"options": {
10+
"cwd": "${workspaceFolder}"
11+
12+
},
13+
"group": {
14+
"kind": "build",
15+
"isDefault": true
16+
},
17+
"problemMatcher": []
18+
},
19+
{
20+
"label": "Build All",
21+
"type": "shell",
22+
"command": "make",
23+
"args": ["build-all"],
24+
"options": {
25+
"cwd": "${workspaceFolder}"
26+
},
27+
"group": "build",
28+
"problemMatcher": []
29+
},
30+
{
31+
"label": "Build Prod",
32+
"type": "shell",
33+
"command": "make",
34+
"args": ["build-prod"],
35+
"options": {
36+
"cwd": "${workspaceFolder}"
37+
},
38+
"group": "build",
39+
"problemMatcher": []
40+
},
41+
{
42+
"label": "Build Cloud",
43+
"type": "shell",
44+
"command": "make",
45+
"args": ["build-cloud"],
46+
"options": {
47+
"cwd": "${workspaceFolder}"
48+
},
49+
"group": "build",
50+
"problemMatcher": []
51+
},
52+
{
53+
"label": "Build ARM64",
54+
"type": "shell",
55+
"command": "make",
56+
"args": ["build-arm64"],
57+
"options": {
58+
"cwd": "${workspaceFolder}"
59+
},
60+
"group": "build",
61+
"problemMatcher": []
62+
},
63+
{
64+
"label": "Build ARMHF",
65+
"type": "shell",
66+
"command": "make",
67+
"args": ["build-armhf"],
68+
"options": {
69+
"cwd": "${workspaceFolder}"
70+
},
71+
"group": "build",
72+
"problemMatcher": []
73+
},
74+
{
75+
"label": "Build AMD64",
76+
"type": "shell",
77+
"command": "make",
78+
"args": ["build-amd64"],
79+
"options": {
80+
"cwd": "${workspaceFolder}"
81+
},
82+
"group": "build",
83+
"problemMatcher": []
84+
},
85+
{
86+
"label": "Clean",
87+
"type": "shell",
88+
"command": "make",
89+
"args": ["clean"],
90+
"options": {
91+
"cwd": "${workspaceFolder}"
92+
},
93+
"problemMatcher": []
94+
},
95+
{
96+
"label": "Test",
97+
"type": "shell",
98+
"command": "make",
99+
"args": ["test"],
100+
"options": {
101+
"cwd": "${workspaceFolder}"
102+
},
103+
"problemMatcher": []
104+
},
105+
{
106+
"label": "Test with Coverage",
107+
"type": "shell",
108+
"command": "make",
109+
"args": ["test-with-coverage"],
110+
"options": {
111+
"cwd": "${workspaceFolder}"
112+
},
113+
"problemMatcher": []
114+
},
115+
{
116+
"label": "Run",
117+
"type": "shell",
118+
"command": "make",
119+
"args": ["run"],
120+
"options": {
121+
"cwd": "${workspaceFolder}"
122+
},
123+
"problemMatcher": []
124+
},
125+
{
126+
"label": "Install",
127+
"type": "shell",
128+
"command": "make",
129+
"args": ["install"],
130+
"options": {
131+
"cwd": "${workspaceFolder}"
132+
},
133+
"problemMatcher": []
134+
},
135+
{
136+
"label": "Install Prod",
137+
"type": "shell",
138+
"command": "make",
139+
"args": ["install-prod"],
140+
"options": {
141+
"cwd": "${workspaceFolder}"
142+
},
143+
"problemMatcher": []
144+
},
145+
{
146+
"label": "Install Cloud",
147+
"type": "shell",
148+
"command": "make",
149+
"args": ["install-cloud"],
150+
"options": {
151+
"cwd": "${workspaceFolder}"
152+
},
153+
"problemMatcher": []
154+
},
155+
{
156+
"label": "Install ARM64",
157+
"type": "shell",
158+
"command": "make",
159+
"args": ["install-arm64"],
160+
"options": {
161+
"cwd": "${workspaceFolder}"
162+
},
163+
"problemMatcher": []
164+
},
165+
{
166+
"label": "Install ARMHF",
167+
"type": "shell",
168+
"command": "make",
169+
"args": ["install-armhf"],
170+
"options": {
171+
"cwd": "${workspaceFolder}"
172+
},
173+
"problemMatcher": []
174+
},
175+
{
176+
"label": "Install AMD64",
177+
"type": "shell",
178+
"command": "make",
179+
"args": ["install-amd64"],
180+
"options": {
181+
"cwd": "${workspaceFolder}"
182+
},
183+
"problemMatcher": []
184+
},
185+
{
186+
"label": "Start",
187+
"type": "shell",
188+
"command": "make",
189+
"args": ["start"],
190+
"options": {
191+
"cwd": "${workspaceFolder}"
192+
},
193+
"problemMatcher": []
194+
},
195+
{
196+
"label": "Stop",
197+
"type": "shell",
198+
"command": "make",
199+
"args": ["stop"],
200+
"options": {
201+
"cwd": "${workspaceFolder}"
202+
},
203+
"problemMatcher": []
204+
},
205+
{
206+
"label": "Restart",
207+
"type": "shell",
208+
"command": "make",
209+
"args": ["restart"],
210+
"options": {
211+
"cwd": "${workspaceFolder}"
212+
},
213+
"problemMatcher": []
214+
},
215+
{
216+
"label": "Status",
217+
"type": "shell",
218+
"command": "make",
219+
"args": ["status"],
220+
"options": {
221+
"cwd": "${workspaceFolder}"
222+
},
223+
"problemMatcher": []
224+
},
225+
{
226+
"label": "Logs",
227+
"type": "shell",
228+
"command": "make",
229+
"args": ["log"],
230+
"options": {
231+
"cwd": "${workspaceFolder}"
232+
},
233+
"problemMatcher": []
234+
}
235+
]
236+
}

Makefile

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,14 @@ GOARCH := $(shell go env GOARCH)
1010

1111

1212
build-all:
13+
@echo "\n🏗️ Building all architectures for ${RELEASE} mode"
14+
@echo "🟡 This will build all supported architectures and release combinations. It can take a while...\n"
15+
1316
GOOS=linux GOARCH=amd64 make build
1417
GOOS=linux GOARCH=arm make build
1518

19+
@echo "\n🟢 All builds completed and available at ./bin/ \n"
20+
1621
build-prod:
1722
GOOS=linux GOARCH=arm RELEASE=prod make build
1823

@@ -30,32 +35,54 @@ build-amd64:
3035

3136

3237
build:
33-
@echo "Building ${GOOS}-${GOARCH}"
38+
@echo "\n🏗️ Building edgeboxctl (${RELEASE} release) on ${GOOS} (${GOARCH})"
39+
@echo "📦 Binary will be saved in ./${BUILD_DIR}/edgeboxctl-${GOOS}-${GOARCH}\n"
40+
3441
GOOS=${GOOS} GOARCH=${GOARCH} go build \
3542
-trimpath -ldflags "-s -w -X ${PROJECT}/internal/diagnostics.Version=${RELEASE} \
3643
-X ${PROJECT}/internal/diagnostics.Commit=${COMMIT} \
3744
-X ${PROJECT}/internal/diagnostics.BuildDate=${BUILD_DATE}" \
3845
-o bin/edgeboxctl-${GOOS}-${GOARCH} ${PROJECT}/cmd/edgeboxctl
3946

47+
@echo "\n🟢 Build task completed\n"
48+
4049
clean:
50+
@echo "🧹 Cleaning build directory and go cache\n"
51+
4152
rm -rf ${BUILD_DIR}
4253
go clean
4354

55+
@echo "\n🟢 Clean task completed\n"
56+
4457
test:
4558
go test -tags=unit -timeout=600s -v ./...
4659

4760
test-with-coverage:
4861
go test -tags=unit -timeout=600s -v ./... -coverprofile=coverage.out
4962

63+
run:
64+
@echo "\n🚀 Running edgeboxctl\n"
65+
./bin/edgeboxctl-${GOOS}-${GOARCH}
66+
5067
install:
68+
@echo "📦 Installing edgeboxctl service (${RELEASE}) for ${GOOS} (${GOARCH})\n"
69+
70+
@echo "🚧 Stopping edgeboxctl service if it is running"
5171
sudo systemctl stop edgeboxctl || true
72+
73+
@echo "\n🗑️ Removing old edgeboxctl binary and service"
5274
sudo rm -rf /usr/local/bin/edgeboxctl /usr/local/sbin/edgeboctl /lib/systemd/system/edgeboxctl.service
75+
76+
@echo "\n🚚 Copying edgeboxctl binary to /usr/local/bin"
5377
sudo cp ./bin/edgeboxctl-${GOOS}-${GOARCH} /usr/local/bin/edgeboxctl
5478
sudo cp ./bin/edgeboxctl-${GOOS}-${GOARCH} /usr/local/sbin/edgeboxctl
79+
80+
@echo "\n🚚 Copying edgeboxctl service to /lib/systemd/system"
5581
sudo cp ./edgeboxctl.service /lib/systemd/system/edgeboxctl.service
5682
sudo systemctl daemon-reload
57-
@echo "Edgeboxctl installed successfully"
58-
@echo "To start edgeboxctl run: systemctl start edgeboxctl"
83+
84+
@echo "\n 🚀 To start edgeboxctl run: make start"
85+
@echo "🟢 Edgeboxctl installed successfully\n"
5986

6087
install-prod: build-prod install
6188
install-cloud: build-cloud install
@@ -64,13 +91,24 @@ install-armhf: build-armhf install
6491
install-amd64: build-amd64 install
6592

6693
start:
94+
@echo "\n 🚀 Starting edgeboxctl service\n"
6795
systemctl start edgeboxctl
96+
@echo "\n 🟢 Edgebox service started\n"
6897

6998
stop:
99+
@echo "\n✋ Stopping edgeboxctl service\n"
70100
systemctl stop edgeboxctl
101+
@echo "\n 🟢 Edgebox service stopped\n"
102+
103+
restart:
104+
@echo "\n💫 Restarting edgeboxctl service\n"
105+
systemctl restart edgeboxctl
106+
@echo "\n 🟢 Edgebox service restarted\n"
71107

72108
status:
109+
@echo "\nℹ️ edgeboxctl Service Info:\n"
73110
systemctl status edgeboxctl
74111

75-
log: start
112+
log:
113+
@echo "\n📰 edgeboxctl service logs:\n"
76114
journalctl -fu edgeboxctl

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ require (
88
github.com/dustin/go-humanize v1.0.0 // indirect
99
github.com/go-ole/go-ole v1.2.5 // indirect
1010
github.com/go-sql-driver/mysql v1.5.0
11+
github.com/go-yaml/yaml v2.1.0+incompatible // indirect
1112
github.com/joho/godotenv v1.3.0
1213
github.com/mattn/go-sqlite3 v1.14.7 // indirect
1314
github.com/shirou/gopsutil v3.21.4+incompatible // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ github.com/go-ole/go-ole v1.2.5 h1:t4MGB5xEDZvXI+0rMjjsfBsD7yAgp/s9ZDkL1JndXwY=
1111
github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
1212
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
1313
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
14+
github.com/go-yaml/yaml v2.1.0+incompatible h1:RYi2hDdss1u4YE7GwixGzWwVo47T8UQwnTLB6vQiq+o=
15+
github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0=
1416
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
1517
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
1618
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=

0 commit comments

Comments
 (0)