amend build + add ps1
This commit is contained in:
parent
7303291221
commit
3eeb80c163
|
@ -6,6 +6,6 @@ ADD files.tar /scripts
|
|||
|
||||
RUN apk --update add bash && bash /scripts/install.sh
|
||||
|
||||
ENV TERM=xterm HTTP_SERVER_NAME=docker-site.dev FIX_OWNERSHIP=1
|
||||
ENV TERM=xterm SHENV_CTX=LOCAL SHENV_NAME=Alpine SHENV_COLOR=97
|
||||
|
||||
ENTRYPOINT ["/scripts/main.sh"]
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
Coff="\033[m"
|
||||
DOCKDIR=$(dirname "$(readlink -f ${BASH_SOURCE[0]})")
|
||||
DOCKBUILD=$(basename $DOCKDIR)
|
||||
DOCKREPO=$(basename $(dirname $(readlink -f ${DOCKBUILD})))
|
||||
DOCKREPO=$(basename $(dirname $DOCKDIR))
|
||||
DOCKTAG=${1:-"latest"}
|
||||
TMPPWD=$(pwd)
|
||||
indent=" "
|
||||
|
|
18
pluie/alpine/install.d/10-ps1.sh
Normal file
18
pluie/alpine/install.d/10-ps1.sh
Normal file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
# pluie/docker-images - a-Sansara (https://github.com/a-sansara)
|
||||
echo "ps1"
|
||||
if [ ! -f /root/.bash_ps1 ]; then
|
||||
echo "existe pas"
|
||||
else
|
||||
echo "existe"
|
||||
fi
|
||||
if [ ! -f /root/.bash_ps1 ]; then
|
||||
cat <<EOF >> /root/.bashrc
|
||||
if [ -f ~/.bash_ps1 ]; then
|
||||
. ~/.bash_ps1
|
||||
fi
|
||||
EOF
|
||||
|
||||
sed -n '1,22 p' /scripts/util.sh > /root/.bash_ps1
|
||||
echo "bash_prompt" >> /root/.bash_ps1
|
||||
fi
|
|
@ -1,6 +1,26 @@
|
|||
#!/bin/bash
|
||||
# pluie/docker-images - a-Sansara (https://github.com/a-sansara)
|
||||
|
||||
function bash_prompt() {
|
||||
local Cenv="243"
|
||||
if [ "$SHENV_CTX" = "INT" ]; then
|
||||
local Cenv="202"
|
||||
elif [ "$SHENV_CTX" = "PROD" ]; then
|
||||
local Cenv="160"
|
||||
fi
|
||||
local Cdate="\033[1;33m"
|
||||
local Cctx="\033[1;48;5;243m"
|
||||
local Cname="\033[1;48;5;${SHENV_COLOR}m"
|
||||
local Cpath="\033[1;38;5;36m"
|
||||
local Cwhite="\033[1;38;5;15m"
|
||||
local Chost="\033[1;38;5;15m"
|
||||
local Csymbol="\033[1;38;5;15m"
|
||||
local Cuser="\033[1;38;5;203m"
|
||||
local Coff="\033[m"
|
||||
|
||||
export PS1="\[${Cdate}\]\t \[${Cwhite}${Cctx}\] DOCKER ${SHENV_CTX} \[${Cname}\] ${SHENV_NAME} \[${Coff} ${Cuser}\]\u\[${Chost}\]@\h \[${Cpath}\]\w \[${Csymbol}\]\$ \[${Coff}\]"
|
||||
}
|
||||
|
||||
function preInit(){
|
||||
for i in ls $1/*.sh
|
||||
do
|
||||
|
|
Loading…
Reference in New Issue
Block a user