update application to work with SSH_KEY_PATH env
continuous-integration/drone/tag Build is passing

This commit is contained in:
2025-09-18 21:24:34 +02:00
parent 99d6c59c70
commit 6ef93d79d2
4 changed files with 4 additions and 2 deletions
+1
View File
@@ -18,5 +18,6 @@ COPY data/config.yaml /app/data/config.yaml
RUN apk add --no-cache bash
ENV SSH_KNOWN_HOSTS=/app/data/known_hosts
ENV SSH_KEY_PATH=/app/data/id_rsa
CMD ["./controlla", "--config-file", "/app/data/config.yaml"]
+2 -1
View File
@@ -70,7 +70,7 @@ docker build -t controlla .
docker run --rm \
-v $(pwd)/config.yaml:/app/data/config.yaml \
-v $(pwd)/skipped.yaml:/app/data/skipped.yaml \
-v ~/.ssh/id_rsa:/app/id_rsa:ro \
-v ~/.ssh/id_rsa:/app/data/id_rsa:ro \
-e TELEGRAM_TOKEN=your_telegram_token \
-e TELEGRAM_CHAT_ID=your_chat_id \
controlla
@@ -127,6 +127,7 @@ trigger:
- `CONTROLLA__DOCKERHUB__USERNAME` — username for private DockerHub access (if needed)
- `CONTROLLA__DOCKERHUB__PASSWORD` — token for private DockerHub access (if needed)
- `SSH_KNOWN_HOSTS` - path in container for known_host file (Default: /app/data/known_hosts)
- `SSH_KEY_PATH` - path in container for ssh key file (Default: /app/data/id_rsa)
---
-1
View File
@@ -2,7 +2,6 @@ git:
repo_url: "git@example.git"
local_repo_path: ./data/repos/myrepo
branch: "main"
ssh_key_path: "./data/id_rsa"
checker:
watch_folder: services
+1
View File
@@ -39,6 +39,7 @@ func LoadConfig(path string) (*AppConfig, error) {
viper.BindEnv("github_token", "CONTROLLA__GITHUB__TOKEN")
viper.BindEnv("telegram_token", "CONTROLLA__TELEGRAM__TOKEN")
viper.BindEnv("telegram_chat_id", "CONTROLLA__TELEGRAM__CHAT__ID")
viper.BindEnv("git.ssh_key_path", "SSH_KEY_PATH")
viper.SetConfigFile(path)
viper.SetConfigType("yaml")