diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 672918b62b16a00004bd17cb7184bd9fcb56de8d..5df614e46ba776b9b97d888492b790240a1acf5d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -270,7 +270,7 @@ jug_xl:nightly: - docker build -t ${CI_REGISTRY_IMAGE}/${BUILD_IMAGE}:${NIGHTLY_TAG} -f containers/jug/xl.Dockerfile --build-arg INTERNAL_TAG=${INTERNAL_TAG} - --build-arg JUG_VERSION=nightly-$(date +%Y-%m-%d_%H-%M-%S)-$(git rev-parse HEAD) + --build-arg JUG_VERSION=nightly-$(date +%Y-%m-%d_%H-%M-%S)-${INTERNAL_TAG}-$(git rev-parse HEAD) containers/jug - | PUSH_FLAG="" diff --git a/containers/jug/eic-env.sh b/containers/jug/eic-env.sh index 15a14c41bb6c00aa998ea50879bab41f44aa35f9..9cd6ebebb3997280b9e6da61f0c9adc5bffb3bc3 100755 --- a/containers/jug/eic-env.sh +++ b/containers/jug/eic-env.sh @@ -6,8 +6,37 @@ for i in /etc/profile.d/*.sh; do fi done -export PS1='eic-shell> \[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' +## default PS1 preamble in case we can't find better info +PS1_PREAMBLE='eic-shell> ' +## try to guess who we are +## note: we use sigils for the following cases: +## - no sigil for nightly builds (jug_xl> ) +## - (*) for master builds (jug_xl*> ) +## - (+) for stable (versioned) (jug_xl+> ) +## - (?) for unstable (MR) (jug_xl?> ) +if [ -f /etc/jug_info ]; then + container=$(grep -e 'jug_' /etc/jug_info | tail -n 1 | awk '{print($2);}') + container=${container%:} ## jug_xl + version=$(grep -e 'jug_' /etc/jug_info | tail -n 1 | awk '{print($3);}') + if [ ! -z ${container} ]; then + if [[ $version =~ 'unstable' ]]; then + sigil="?" + elif [[ $version =~ 'testing' ]]; then + sigil="*" + elif [[ $version =~ 'nightly' ]]; then + sigil="" + else # stable + sigil="+" + fi + PS1_PREAMBLE="${container}${sigil}> " + unset sigil + fi + unset version + unset container +fi +export PS1=${PS1_PREAMBLE}'\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' export LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33' +unset PS1_PREAMBLE ## redefine ls and less as functions, as this is something we ## can import into our plain bash --norc --noprofile session diff --git a/containers/jug/xl.Dockerfile b/containers/jug/xl.Dockerfile index 30b230be79bc5182340120c7ed5c9ede2846a9f7..12f81b2de66a490b98129399259472df58c0da8f 100644 --- a/containers/jug/xl.Dockerfile +++ b/containers/jug/xl.Dockerfile @@ -143,3 +143,4 @@ RUN mkdir -p /opt/campaigns https://eicweb.phy.anl.gov/EIC/campaigns/condor.git \ && git clone -b ${CAMPAIGNS_SLURM_VERSION} --depth 1 \ https://eicweb.phy.anl.gov/EIC/campaigns/slurm.git +