mirror of
https://github.com/coderofsalvation/podi.git
synced 2025-12-16 03:47:45 +01:00
recipe sshkey
This commit is contained in:
32
.podmen/envfile
Normal file
32
.podmen/envfile
Normal 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
|
||||
5
.podmen/git@localhost/app/config
Normal file
5
.podmen/git@localhost/app/config
Normal file
@@ -0,0 +1,5 @@
|
||||
export server='localhost'
|
||||
export port='2222'
|
||||
export user='git'
|
||||
export gitpath='/home/git/app'
|
||||
export appname='app'
|
||||
5
.podmen/git@localhost/app3/config
Normal file
5
.podmen/git@localhost/app3/config
Normal file
@@ -0,0 +1,5 @@
|
||||
export server='localhost'
|
||||
export port='2222'
|
||||
export user='git'
|
||||
export gitpath='/home/git/app3'
|
||||
export appname='app3'
|
||||
4
.podmen/git@localhost/config
Normal file
4
.podmen/git@localhost/config
Normal file
@@ -0,0 +1,4 @@
|
||||
export server='localhost'
|
||||
export port='2222'
|
||||
export user='git'
|
||||
export gitpath='/home/git/app'
|
||||
10
.podmen/hello
Normal file
10
.podmen/hello
Normal 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
14
.podmen/pipeline
Normal 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
|
||||
Reference in New Issue
Block a user