From 9de7b27942524947b23b4044de378ffbf6ef2dcb Mon Sep 17 00:00:00 2001 From: tuutti Date: Mon, 16 Dec 2024 12:27:26 +0200 Subject: [PATCH] Shell alias to check package status --- openshift/drupal/Dockerfile | 15 +++++++-------- openshift/drupal/files/etc/profile | 1 - openshift/drupal/files/etc/profile.d/aliases.sh | 5 +++++ openshift/drupal/files/etc/profile.d/ps1.sh | 1 + 4 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 openshift/drupal/files/etc/profile.d/aliases.sh create mode 100644 openshift/drupal/files/etc/profile.d/ps1.sh diff --git a/openshift/drupal/Dockerfile b/openshift/drupal/Dockerfile index c6894b5..56a22f0 100644 --- a/openshift/drupal/Dockerfile +++ b/openshift/drupal/Dockerfile @@ -25,17 +25,9 @@ RUN set -eux; \ jq \ tini -RUN \ - touch /etc/bash/ps1.sh && \ - echo 'export PS1="[${APP_ENV:-env}] \[\e[1;31m\][${HOSTNAME:-hostname}] \[\e[1;33m\]\w\[\e[0m\] $ "' | tee /etc/profile /etc/bash/ps1.sh - COPY --from=composer:latest /usr/bin/composer /usr/local/bin/ COPY --from=amazeeio/envplate:v1.0.3 /usr/local/bin/ep /usr/local/bin/ep -ENV PATH=${PATH}:/app/vendor/bin:/var/www/html/vendor/bin -ENV COMPOSER_HOME=/.composer -ENV ENV="/etc/profile" - # Fetch the required certificate for the Azure MySQL flexible server service ENV AZURE_SQL_SSL_CA_PATH=/usr/local/share/ca-certificates/DigiCertGlobalRootCA.crt.pem RUN wget https://dl.cacerts.digicert.com/DigiCertGlobalRootCA.crt.pem -O $AZURE_SQL_SSL_CA_PATH @@ -53,9 +45,16 @@ EXPOSE 8080 # Copy configuration files and scripts COPY files/ / +# Copy /etc/profile.d shell scripts to bash equivalent as well. +COPY files/etc/profile.d/ /etc/bash + RUN chmod +x /entrypoints/* && \ chmod +x /usr/local/bin/entrypoint +ENV PATH=${PATH}:/app/vendor/bin:/var/www/html/vendor/bin +ENV COMPOSER_HOME=/.composer +ENV ENV="/etc/profile" + RUN \ # Create missing nginx folder. mkdir -p /run/nginx && \ diff --git a/openshift/drupal/files/etc/profile b/openshift/drupal/files/etc/profile index dcdad3c..3ab9f08 100755 --- a/openshift/drupal/files/etc/profile +++ b/openshift/drupal/files/etc/profile @@ -31,4 +31,3 @@ for script in /etc/profile.d/*.sh ; do fi done unset script -export PS1="[${APP_ENV:-env}] \[\e[1;31m\][${HOSTNAME:-hostname}] \[\e[1;33m\]\w\[\e[0m\] $ " diff --git a/openshift/drupal/files/etc/profile.d/aliases.sh b/openshift/drupal/files/etc/profile.d/aliases.sh new file mode 100644 index 0000000..1b8ad3e --- /dev/null +++ b/openshift/drupal/files/etc/profile.d/aliases.sh @@ -0,0 +1,5 @@ +function helfi_check_packages { + composer show "drupal/helfi_*" $@ + composer show "drupal/hdbt*" $@ +} +alias helfi_check_package_status='helfi_check_packages --outdated' diff --git a/openshift/drupal/files/etc/profile.d/ps1.sh b/openshift/drupal/files/etc/profile.d/ps1.sh new file mode 100644 index 0000000..3a7a29a --- /dev/null +++ b/openshift/drupal/files/etc/profile.d/ps1.sh @@ -0,0 +1 @@ +export PS1="[${APP_ENV:-env}] \[\e[1;31m\][${HOSTNAME:-hostname}] \[\e[1;33m\]\w\[\e[0m\] $ "