add config-file flag
continuous-integration/drone/tag Build is passing

This commit is contained in:
2025-09-18 20:28:42 +02:00
parent 3822e1a5e9
commit 63bf473fde
4 changed files with 10 additions and 6 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
id_rsa
data/id_rsa
repos/
skipped.yaml
+2 -2
View File
@@ -12,9 +12,9 @@ WORKDIR /app
# Copy the binary and config file from the builder stage
COPY --from=builder /app/controlla /app/
COPY config.yaml /app/
COPY data/config.yaml /app/data/config.yaml
# Install bash for potential scripting needs
RUN apk add --no-cache bash
CMD ["./controlla"]
CMD ["./controlla --config-file /app/data/config.yaml"]
+2 -2
View File
@@ -1,8 +1,8 @@
git:
repo_url: "git@example.git"
local_repo_path: ./repos/myrepo
local_repo_path: ./data/repos/myrepo
branch: "main"
ssh_key_path: "id_rsa"
ssh_key_path: "./data/id_rsa"
checker:
watch_folder: services
+5 -1
View File
@@ -13,6 +13,7 @@ import (
"crypto/sha1"
"encoding/base64"
"encoding/hex"
"flag"
"fmt"
"log"
"os"
@@ -153,12 +154,15 @@ func handleCallbackQuery(bot *tgbotapi.BotAPI, callback *tgbotapi.CallbackQuery,
// Main entry point for the controlla application.
// This service checks container images for updates and notifies via Telegram.
func main() {
// Parse command-line flags
configPath := flag.String("config-file", "./data/config.yaml", "Path to config file")
flag.Parse()
// Set up logging format and level
logrus.SetFormatter(&logrus.TextFormatter{FullTimestamp: true})
logrus.SetLevel(logrus.InfoLevel)
// Load application configuration from YAML file
appConfig, err := config.LoadConfig("config.yaml")
appConfig, err := config.LoadConfig(*configPath)
if err != nil {
log.Fatalf("Error loading application configuration: %v", err)
}