Skip to content

Commit

Permalink
update: yolo web term
Browse files Browse the repository at this point in the history
  • Loading branch information
codekow committed Nov 11, 2023
1 parent 1505fcb commit d9274d2
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,9 @@ spec:
- "-c"
- |
#!/bin/bash
GIT_REPO=https://github.com/codekow/demo-ai-gitops-catalog.git
YOLO_URL=https://raw.githubusercontent.com/codekow/demo-ai-gitops-catalog/main/scripts/library/term.sh
echo "
echo
GIT_REPO=${GIT_REPO}
printf 'This terminal has been \e[0;32m~Enhanced~\e[0m\n'
printf 'See \033[34;1;1m'${GIT_REPO}'\e[0m\n\n'
" >> ~/.bashrc
git clone "${GIT_REPO}" gitops
echo "
cd gitops; . scripts/functions.sh; cd ..
__git_branch(){
git name-rev --name-only @ 2>/dev/null
}
PS1='\e]\s\a\n\e[33m\w \e[36m\$(__git_branch)\e[m$ '
[ -e ~/.venv/bin/activate ] && . ~/.venv/bin/activate
[ -e ~/gitops/scratch/bin/restic.bash ] && . ~/gitops/scratch/bin/restic.bash
cd ~/gitops
" >> ~/.bashrc
cd gitops
. scripts/functions.sh
[ -d ~/.venv ] || pyvenv-3.6 ~/.venv
bin_check busybox
bin_check oc-mirror
bin_check rclone
bin_check restic
curl "${YOLO_URL}" | bash
sleep infinity
Expand Down
46 changes: 46 additions & 0 deletions scripts/library/term.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

GIT_REPO=https://github.com/codekow/demo-ai-gitops-catalog.git

term_init(){
# avoid making everyone mad
grep -q 'OpenShift Web Terminal' ~/.bashrc && return 1

# shellcheck disable=SC2028
echo "
echo
GIT_REPO=${GIT_REPO}
printf 'This terminal has been \e[0;32m~Enhanced~\e[0m\n'
printf 'See \033[34;1;1m'${GIT_REPO}'\e[0m\n\n'
__git_branch(){
git name-rev --name-only @ 2>/dev/null
}
PS1='\e]\s\a\n\e[33m\w \e[36m\$(__git_branch)\e[m$ '
if [ -e gitops ]; then
cd gitops
. scripts/functions.sh
fi
[ -e ~/.venv/bin/activate ] && . ~/.venv/bin/activate
[ -e ~/gitops/scratch/bin/restic.bash ] && . ~/gitops/scratch/bin/restic.bash
" >> ~/.bashrc

git clone "${GIT_REPO}" gitops
cd gitops || return
# shellcheck disable=SC1091
. scripts/functions.sh

[ -d ~/.venv ] || pyvenv-3.6 ~/.venv

bin_check busybox

bin_check oc-mirror
bin_check rclone
bin_check restic

sleep infinity # just in case
}

0 comments on commit d9274d2

Please sign in to comment.