Browse Source

add build number

Andreas Peters 5 months ago
parent
commit
f70b246f12
Signed by: Andreas Peters <ap@aventer.biz> GPG Key ID: 6A83F12541CFCCF9
5 changed files with 10 additions and 3 deletions
  1. 1
    0
      .gitignore
  2. 3
    0
      Dockerfile
  3. 4
    1
      app.go
  4. 1
    1
      run.sh
  5. 1
    1
      services/gitea/gitea.go

+ 1
- 0
.gitignore View File

@@ -3,3 +3,4 @@ config.yaml
3 3
 log/*.log*
4 4
 data/config.yaml
5 5
 .vscode
6
+app

+ 3
- 0
Dockerfile View File

@@ -29,6 +29,9 @@ VOLUME /go-avbot/data
29 29
 COPY . /go-avbot/
30 30
 COPY run.sh /run.sh
31 31
 
32
+RUN cd /go-avbot && \
33
+    go build -ldflags "-X main.MinVersion=`date -u +%Y%m%d%.H%M%S`" app.go init.go
34
+
32 35
 EXPOSE 4050
33 36
 
34 37
 ENTRYPOINT ["/run.sh"]

+ 4
- 1
app.go View File

@@ -50,6 +50,9 @@ var ConfigFile string
50 50
 // LogDir is the directory where the bot will log in
51 51
 var LogDir string
52 52
 
53
+// MinVersion is the BuildVersion Number
54
+var MinVersion string
55
+
53 56
 // loadFromConfig loads a config file and returns a ConfigFile
54 57
 func loadFromConfig(db *database.ServiceDB, configFilePath string) (*api.ConfigFile, error) {
55 58
 	// ::Horrible hacks ahead::
@@ -234,7 +237,7 @@ func main() {
234 237
 		))
235 238
 	}
236 239
 
237
-	log.Infof("GO-AVBOT (%s %s %s %s %s %s)", BindAddress, BaseURL, DatabaseType, DatabaseURL, LogDir, ConfigFile)
240
+	log.Infof("GO-AVBOT build %s (%s %s %s %s %s %s)", MinVersion, BindAddress, BaseURL, DatabaseType, DatabaseURL, LogDir, ConfigFile)
238 241
 
239 242
 	setup(http.DefaultServeMux, http.DefaultClient)
240 243
 	log.Fatal(http.ListenAndServe(BindAddress, nil))

+ 1
- 1
run.sh View File

@@ -5,4 +5,4 @@ cd /go-avbot/
5 5
 ls -l
6 6
 pwd
7 7
 ls -l ./data
8
-go run init.go app.go $@
8
+./app $@

+ 1
- 1
services/gitea/gitea.go View File

@@ -34,7 +34,7 @@ var httpClient = &http.Client{}
34 34
 //   {
35 35
 //       rooms: {
36 36
 //           "!ewfug483gsfe:localhost": {
37
-//               boards: {
37
+//               repos: {
38 38
 //                   "1" {
39 39
 //                   }
40 40
 //               }

Loading…
Cancel
Save