Skip to content

Commit 1fa0eea

Browse files
chore(core): establish bin/ and dist/ artifact separation (#256)
1 parent ccb3bb1 commit 1fa0eea

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches: ["main"]
66
paths:
77
- "cmd/web/**"
8+
- "internal/web/**"
89
workflow_dispatch:
910

1011
permissions:
@@ -36,7 +37,7 @@ jobs:
3637
- name: Upload artifact
3738
uses: actions/upload-pages-artifact@v4
3839
with:
39-
path: ./cmd/web/dist
40+
path: ./dist
4041

4142
deploy:
4243
runs-on: ubuntu-latest

cmd/web/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
func main() {
11-
if err := generator.Build("../../internal/web", "dist"); err != nil {
11+
if err := generator.Build("../../internal/web", "../../dist"); err != nil {
1212
log.Fatalf("Site generation failed: %v", err)
1313
}
1414
fmt.Println("Site generated successfully in dist/")

makefiles/go.mk

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,22 @@ setup-tailwind:
5555

5656
web-build: setup-tailwind
5757
$(NIX_WRAP) echo "Running web build..." && \
58-
rm -rf cmd/web/dist && \
59-
mkdir -p cmd/web/dist && \
58+
rm -rf dist && \
59+
mkdir -p dist && \
6060
(cd cmd/web && go build -o ../../web-ssg .) && \
6161
(cd cmd/web && ../../web-ssg) && \
62-
./tailwindcss -i ./internal/web/templates/input.css -o ./cmd/web/dist/styles.css --minify && \
62+
./tailwindcss -i ./internal/web/templates/input.css -o ./dist/styles.css --minify && \
6363
rm web-ssg && \
6464
rm tailwindcss
6565

6666
proxy-build:
6767
$(NIX_WRAP) \
6868
echo "Updating Proxy..." && \
69-
cd cmd/proxy && go build -o ../../dist/proxy_server . && \
69+
cd cmd/proxy && go build -o ../../bin/proxy_server . && \
7070
sudo systemctl restart proxy.service
7171

7272
ingestion-build:
7373
$(NIX_WRAP) \
7474
echo "Updating ingestion service..." && \
75-
cd cmd/ingestion && go build -o ../../dist/ingestion . && \
75+
cd cmd/ingestion && go build -o ../../bin/ingestion . && \
7676
sudo systemctl restart ingestion.timer

systemd/ingestion.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Type=oneshot
88
User=server
99
WorkingDirectory=/home/server/software/observability-hub
1010
EnvironmentFile=/home/server/software/observability-hub/.env
11-
ExecStart=/home/server/software/observability-hub/dist/ingestion
11+
ExecStart=/home/server/software/observability-hub/bin/ingestion
1212
StandardOutput=journal
1313
StandardError=journal
1414

systemd/proxy.service

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ After=network.target postgresql.service
66
Type=simple
77
User=server
88
WorkingDirectory=/home/server/software/observability-hub
9-
# Pointing to the binary we will build
10-
ExecStart=/home/server/software/observability-hub/dist/proxy_server
9+
EnvironmentFile=/home/server/software/observability-hub/.env
10+
ExecStart=/home/server/software/observability-hub/bin/proxy_server
1111
Restart=always
1212
RestartSec=5
13-
# Load environment variables from the root .env
14-
EnvironmentFile=/home/server/software/observability-hub/.env
1513
StandardOutput=journal
1614
StandardError=journal
1715

0 commit comments

Comments
 (0)