mirror of
https://github.com/coderofsalvation/podi.git
synced 2025-12-16 03:47:45 +01:00
work in progress [might break]
This commit is contained in:
10
podi
10
podi
@@ -49,6 +49,7 @@ trigger() { printf "$C_NORMAL [$C_CYAN✓$C_NORMAL] $C_BOLD%s$C_NORMAL\n" "$1
|
||||
return $?
|
||||
}
|
||||
on() { export on_$1="$2 $(eval echo \$on_$1)"; }
|
||||
init_dirs() { test -d .git || git init; test -d .pod || mkdir .pod; }
|
||||
|
||||
init_post_receive(){
|
||||
echo "#!/bin/sh
|
||||
@@ -98,7 +99,7 @@ init(){ # init git@server:/dir/to/deploy [branch] [port] [name] : initializes a
|
||||
}
|
||||
|
||||
init_localhost(){
|
||||
test -d .git || git init
|
||||
init_dirs
|
||||
test -f .pod/pipeline || {
|
||||
test -d .pod || mkdir -p .pod
|
||||
test -f .pod/pipeline || recipe pipeline
|
||||
@@ -135,7 +136,7 @@ init_server(){
|
||||
scp -r -P $port $0 .pod $user@$server:$gitpath/. 1>/dev/null
|
||||
try ssh -p $port $user@$server "cd $gitpath; ./podi init_gitops $gitpath $server $user $port"
|
||||
set +e
|
||||
test -d .git || git init
|
||||
init_dirs
|
||||
init_remotes
|
||||
silent git push $appname $branch
|
||||
print "you can now run: git push $appname $branch"
|
||||
@@ -163,10 +164,9 @@ recipe(){ # recipe <name_or_url> : installs a recipe from podi repo or url
|
||||
done
|
||||
}
|
||||
install(){
|
||||
init_dirs
|
||||
for repo in $RECIPE_REPOS; do
|
||||
curl -s $repo | silent grep -E "^$1$" && {
|
||||
test -d .git || git init
|
||||
test -d .pod || mkdir .pod
|
||||
print "writing .pod/$1"
|
||||
dir=$(dirname $1)
|
||||
test -d .pod/$dir || mkdir -p .pod/$dir
|
||||
@@ -179,6 +179,7 @@ recipe(){ # recipe <name_or_url> : installs a recipe from podi repo or url
|
||||
}
|
||||
|
||||
init_remotes(){
|
||||
find .pod | silent grep config || return 0
|
||||
for config in .pod/*@*/*/config; do
|
||||
. $config
|
||||
git remote | silent grep $appname || {
|
||||
@@ -189,6 +190,7 @@ init_remotes(){
|
||||
}
|
||||
|
||||
usage(){
|
||||
init_dirs
|
||||
test -d .git && silent grep "bare = true" .git/config && error "dont use podi on production server"
|
||||
echo "usage: "
|
||||
awk '/[a-zA-Z0-9_]+\(\){ #/ {
|
||||
|
||||
Reference in New Issue
Block a user