#!/bin/bash
# ===========================================================================
# Copyright (c) 2021, 2023 Eclipse Foundation and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
#    Christopher Guindon (Eclipse Foundation)
# ==========================================================================

# Print the PHP version
php --version

cd /localsite/eclipse.org-downloads-packages
drush make /home/devops/build/drupal.make . --working-copy --force-gitinfofile --prepare-install
cp /home/devops/build/settings.php /localsite/eclipse.org-downloads-packages/sites/default/settings.php
cp /home/devops/php/configs/shared-settings.php /localsite/eclipse.org-downloads-packages/sites/default/shared-settings.php

# Setting lose permission to allow file edit on host
chown -R 1000:33 /var/www/html /localsite /home
chmod -R g+w /var/www/html /localsite /home