midr @ c430ebff167dcfc073c1c6a3375d6284936218a7

feat: Add build pieces

Adding pieces to be able to later build to alpine
 1diff --git a/Makefile b/Makefile
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..43e0f57892ac4bcdeafabde64fdb4d040360ef04
 4--- /dev/null
 5+++ b/Makefile
 6@@ -0,0 +1,7 @@
 7+VERSION=v0.1.0
 8+
 9+build:
10+	go build -ldflags="-X 'main.Version=${VERSION}'"
11+
12+tar: build
13+	XZ_OPT=-9 tar -cvf midr-${VERSION}.tar.xz midr templates/
14diff --git a/build.yml b/build.yml
15new file mode 100644
16index 0000000000000000000000000000000000000000..3bb5c8e8fa9f3943052ea36afe49a9519d5d5fbd
17--- /dev/null
18+++ b/build.yml
19@@ -0,0 +1,27 @@
20+# this build is meant to be submitted manually
21+image: fedora/36
22+packages:
23+  - rsync
24+  - make
25+  - go
26+
27+sources:
28+  - https://git.sr.ht/~gabrielgio/midr
29+
30+secrets:
31+  - 008c4f67-b864-47f8-9790-cd32f2ae8516
32+
33+environment:
34+  deploy: builds@gabrielgio.me
35+  target: artifacts.gabrielgio.me/midr
36+
37+tasks:
38+  - build: |
39+      cd midr
40+      make tar
41+  - deploy: |
42+      cd jnfilter
43+      sshopts="ssh -o StrictHostKeyChecking=no"
44+      rsync --rsh="$sshopts" -rP *.tar.xz $deploy:/var/www/$target
45+
46+
47diff --git a/main.go b/main.go
48index d5fc7193cef4d950489239a0127c2bf76d75f381..d47424fb5281ab51a6977268de61ff09e4b4455a 100644
49--- a/main.go
50+++ b/main.go
51@@ -1,11 +1,16 @@
52 package main
53 
54 import (
55+	"fmt"
56+
57 	"git.sr.ht/~gabrielgio/midr/db"
58 	"git.sr.ht/~gabrielgio/midr/routes"
59 )
60 
61+var Version = "development"
62+
63 func main() {
64+	fmt.Println("Version:\t", Version)
65 	db.ConnectDb()
66 	routes.HandleRequests()
67 }