recipe sshkey

This commit is contained in:
Leon
2022-02-09 21:22:21 +01:00
parent 8562ed09f1
commit 214a3e377e
6 changed files with 70 additions and 0 deletions

32
.podmen/envfile Normal file
View File

@@ -0,0 +1,32 @@
# installation : run 'podmen recipe env-file' or put this file into .podman folder
# example usage: * put an .env file in your repo (with 'export FOO=1' e.g.)
# * override them on remote-server using './podmen .env git@server FOO=2'
# * run './podmen .env' to see all local/remote env-vars
recipe_envfile(){
trigger recipe:envfile
test -f .env && print "reading '.env'" && . .env
test -f .env.live && print "override '.env' << .env.live" && . .env.live
print PORT=$PORT
}
envset(){ # envset [remote] [FOO=bar] : shows or sets [remote] environment variables
test -f .env || echo 'export FOO=bar # used for development' > .env
test -z $1 && {
test -f .env || echo 'export PORT=1234' > .env; print .env; echo; cat .env; echo;
for i in .podmen/*@*; do $0 envset $(basename $i); echo; done
exit 0;
}
loadremote $1
if ! test -z "$2"; then
printf "export %-40s # $(date)\n" "$2\"" | awk '{ gsub("=","=\"",$0); print $0; }' | ssh -p $port $1 "cat >> $gitpath/.env.live"
print OK
else
print $1:$gitpath/.env.live:
echo
test -z $2 && ssh -p $port $1 "test -f $gitpath/.env.live && cat $gitpath/.env.live || echo no env-vars yet"
echo
fi
}
on start recipe_envfile

View File

@@ -0,0 +1,5 @@
export server='localhost'
export port='2222'
export user='git'
export gitpath='/home/git/app'
export appname='app'

View File

@@ -0,0 +1,5 @@
export server='localhost'
export port='2222'
export user='git'
export gitpath='/home/git/app3'
export appname='app3'

View File

@@ -0,0 +1,4 @@
export server='localhost'
export port='2222'
export user='git'
export gitpath='/home/git/app'

10
.podmen/hello Normal file
View File

@@ -0,0 +1,10 @@
# a barebones recipe
hello(){ echo ' \o/ hello' ; }
world(){ echo ' world' ; }
mycmd(){ # mycmd [myopt] : simple example cmd
echo "howdy! $1"
}
on hello world

14
.podmen/pipeline Normal file
View File

@@ -0,0 +1,14 @@
deploy(){
trigger hello
trigger backup
trigger extract
trigger build
trigger runtests
trigger start
}
checkout(){
alias git="git --work-tree=$(pwd) --git-dir=$(pwd)/.git"
git checkout -f
}
# wo 9 feb 2022 13:02:23 CET