From 74a998b28e4206ebc79d559733eeb6a0fe94effc Mon Sep 17 00:00:00 2001 From: Fletcher Nichol Date: Fri, 20 May 2016 10:37:02 -0600 Subject: [PATCH] [devshell] Give the shell start a little pop of color. This change will report if the following environment variables are set and non-empty: * `HAB_ORIGIN` * `HAB_DEPOT_URL` * `http_proxy` * `https_proxy` Thanks to @reset for the idea! Signed-off-by: Fletcher Nichol Pull request: #556 Approved by: reset --- .dockerignore | 2 ++ Dockerfile | 3 ++- support/devshell_profile.sh | 28 ++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 support/devshell_profile.sh diff --git a/.dockerignore b/.dockerignore index 030247d7af6..eaf24be9841 100644 --- a/.dockerignore +++ b/.dockerignore @@ -8,7 +8,9 @@ demo images log plans +results support +!support/devshell_profile.sh tmp vendor www diff --git a/Dockerfile b/Dockerfile index 99e5e318ede..a671a1ca4bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,6 +45,7 @@ RUN ln -snf /usr/bin/nodejs /usr/bin/node && npm install -g docco && echo "docco RUN (adduser --system hab || true) && (addgroup --system hab || true) +COPY support/devshell_profile.sh /root/.bash_profile COPY .delivery/scripts/ssh_wrapper.sh /usr/local/bin COPY .delivery/scripts/git_src_checkout.sh /usr/local/bin COPY components/hab/install.sh /tmp @@ -54,4 +55,4 @@ RUN /tmp/install.sh \ && rm -rf /tmp/install.sh /hab/cache/{keys,artifacts} WORKDIR /src -CMD ["bash"] +CMD ["bash", "-l"] diff --git a/support/devshell_profile.sh b/support/devshell_profile.sh new file mode 100644 index 00000000000..378a8d16d19 --- /dev/null +++ b/support/devshell_profile.sh @@ -0,0 +1,28 @@ +info() { + case "${TERM:-}" in + *term | xterm-* | rxvt | screen | screen-*) + printf -- " \033[1;36mHabitat devshell: \033[1;37m$1\033[0m\n" + ;; + *) + printf -- " devshell: $1\n" + ;; + esac + return 0 +} + +echo +info 'Plan for success!' + +if [[ -n "$HAB_ORIGIN" ]]; then + info "Exported: HAB_ORIGIN=$HAB_ORIGIN" +fi +if [[ -n "$HAB_DEPOT_URL" ]]; then + info "Exported: HAB_DEPOT_URL=$HAB_DEPOT_URL" +fi +if [[ -n "$http_proxy" ]]; then + info "Exported: http_proxy=$http_proxy" +fi +if [[ -n "$https_proxy" ]]; then + info "Exported: https_proxy=$https_proxy" +fi +echo