From 23b90cb509152e053310250db6d6a1c5e097ee82 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Fri, 21 Jul 2023 20:51:06 +0200 Subject: [PATCH] test --- app.sh | 30 ++++++++++-------------------- docker-compose.yml | 25 ++++++++++++++++--------- 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/app.sh b/app.sh index 6fdabca..c14e406 100644 --- a/app.sh +++ b/app.sh @@ -1,27 +1,7 @@ #!/bin/bash -# setze Variable -# Format , -DEVICES="rb5009.grote.lan,/home/mg/oxidized-selfmade/neu - hex.grote.lan,/ssh/keys/hex" - - -GIT_REPO_PATH=/home/mg/oxidized-selfmade # wo soll das Repo angelegt werden -GIT_REPO_BRANCH=master -GIT_USERNAME=oxidized-selfmade -GIT_USER_MAIL=michael.grote@posteo.de -GIT_REPO_REMOTE_NAME=origin -INTERVAL=3600 # in Sekunden - -FAILFILE=$(mktemp) - - while true ; do # Checks - if [ -z "$GIT_REPO_PATH" ] ; then - echo "GIT_REPO_PATH is not set." - exit 3 - fi if [ -z "$INTERVAL" ] ; then echo "INTERVAL is not set." exit 3 @@ -46,6 +26,16 @@ while true ; do echo "DEVICES is not set." exit 3 fi + if [ -z "$GIT_REPO_DEPLOY_KEY" ] ; then + echo "GIT_REPO_DEPLOY_KEY is not set." + exit 3 + fi + if [ -z "$GIT_REPO_URL" ] ; then + echo "GIT_REPO_URL is not set." + exit 3 + fi + + GIT_REPO_PATH=$(/tmp/tmp.gUcRmxSldg) git config --global user.email "$GIT_USER_MAIL" git config --global user.name "$GIT_USERNAME" diff --git a/docker-compose.yml b/docker-compose.yml index 67e9f2a..bf45f66 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,18 +3,25 @@ version: "3" services: routeros-config-export: image: registry.mgrote.net/oxidized-selfmade:latest - environment: - - DEVICE_CONFIGS=rb5009.grote.lan,test,/keys/rb5009 - - GIT_REPO_PATH=/repo - - GIT_REPO_URL=ssh://gitea@git.mgrote.net:2222/mg/network-configs.git - - GIT_USERNAME=gitea # nur für comitter name - - GIT_SSH_KEY=/keys/git volumes: # key rb5009 - - ./keys/rb5009:/keys/rb5009:ro - # git - - ./keys/git:/keys/git:ro + - /home/mg/neu:/neu:ro # Add any other volumes or configurations needed # der zweite key für admin auf dem router ist der hier, in irantu/wsl hinterlegt + + + + environment: + # Format , #siehe volunmes + - DEVICES: | + rb5009.grote.lan,/neu + hex.grote.lan,/ssh/keys/hex + - GIT_REPO_BRANCH: "master" + - GIT_REPO_URL: "ssh://gitea@git.mgrote.net:2222/mg/testrepo.git" + - GIT_REPO_DEPLOY_KEY: "/neu" #siehe volunmes + - GIT_USERNAME: oxidized-selfmade + - GIT_USER_MAIL: michael.grote@posteo.de + - GIT_REPO_REMOTE_NAME: origin + - INTERVAL: 3600 # in Sekunden