File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ RUN \
122122
123123# ## Add drupal 10 related drush
124124RUN \
125- cd /var/www/html && \
125+ cd /tmp/drupal-* && \
126126 composer update && \
127127 composer update "drupal/core-*" --with-all-dependencies && \
128128 composer require drush/drush --with-all-dependencies
Original file line number Diff line number Diff line change @@ -12,9 +12,4 @@ if [ -d /tmp/drupal-${LATEST_VERSION} ]; then
1212fi
1313echo " Downloading Drupal $LATEST_VERSION ..."
1414curl -s " https://ftp.drupal.org/files/projects/drupal-${LATEST_VERSION} .tar.gz" | tar -xz -C /tmp
15- if [ ! -d /var/www/html ]; then
16- mkdir -p /var/www/html
17- fi
18- mv /tmp/drupal-$LATEST_VERSION /* /tmp/drupal-$LATEST_VERSION /.[! .]* /var/www/html/
19- rm -Rf /tmp/drupal-$LATEST_VERSION
20- echo " Drupal $LATEST_VERSION downloaded on /var/www/html"
15+ echo " Drupal $LATEST_VERSION downloaded to /tmp/drupal-${LATEST_VERSION} "
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3+ # Check if /var/www/html is empty
4+ if [ -z " $( ls -A /var/www/html) " ]; then
5+ echo " Directory /var/www/html is empty, copying Drupal files..."
6+ # Find the drupal directory under /tmp
7+ DRUPAL_DIR=$( find /tmp -maxdepth 1 -type d -name " drupal-*" | sort -V | tail -n 1)
8+ if [ -n " $DRUPAL_DIR " ]; then
9+ echo " Found Drupal directory: $DRUPAL_DIR "
10+ cp -r $DRUPAL_DIR /* $DRUPAL_DIR /.[! .]* /var/www/html/
11+ chown -R www-data:www-data /var/www/html
12+ echo " Drupal files copied successfully"
13+ else
14+ echo " Error: Drupal directory not found in /tmp"
15+ exit 1
16+ fi
17+ fi
18+
319# Ensure the directory exists
420mkdir -p /var/www/html/log/supervisor
521
You can’t perform that action at this time.
0 commit comments