Skip to content

Instantly share code, notes, and snippets.

@guoxiangke
Created July 28, 2016 04:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guoxiangke/c9eaa79f41ebcc1575bc40a1619b3078 to your computer and use it in GitHub Desktop.
Save guoxiangke/c9eaa79f41ebcc1575bc40a1619b3078 to your computer and use it in GitHub Desktop.
drupal8 start project makefile
DRUPAL_VERSION ?= 8.1.7
default: build
build: build-drupal
#chown -R $(WWW_USER):$(WWW_GROUP) ./build
# when any changes in backend ,do build-drupal
build-drupal:
cp -rf ./backend/modules ./public_html/
# cp -rf ./backend/profiles ./public_html/
# cp -rf ./backend/sites ./public_html/
cp -rf ./backend/themes ./public_html/
cp -rf ./backend/.htaccess ./public_html/
cp -rf ./backend/robots.txt ./public_html/
cp -rf ./backend/.gitignore ./public_html/
build-drupal-upgrade:
rm -rf public_html
mkdir public_html
rm -rf drupal
mkdir drupal
wget -O ./drupal/drupal.zip https://ftp.drupal.org/files/projects/drupal-$(DRUPAL_VERSION).zip
unzip ./drupal/drupal.zip -d ./drupal/
cp -rf ./drupal/drupal-$(DRUPAL_VERSION)/core/. ./public_html/core/
cp -rf ./drupal/drupal-$(DRUPAL_VERSION)/vendor/. ./public_html/vendor/
cp ./drupal/drupal-$(DRUPAL_VERSION)/*.* ./public_html/
cp ./drupal/drupal-$(DRUPAL_VERSION)/.??* ./public_html/
rm -rf drupal
cp -rf ./backend/modules ./public_html/
cp -rf ./backend/profiles ./public_html/
# cp -rf ./backend/sites ./public_html/
cp -rf ./backend/themes ./public_html/
cp -rf ./backend/.htaccess ./public_html/
cp -rf ./backend/robots.txt ./public_html/
cp -rf ./backend/.gitignore ./public_html/
#@ init a drupal8 project!
build-drupal-init:
rm -rf public_html
mkdir public_html
rm -rf drupal
mkdir drupal
wget -O ./drupal/drupal.zip https://ftp.drupal.org/files/projects/drupal-$(DRUPAL_VERSION).zip
unzip ./drupal/drupal.zip -d ./drupal/
cp -rf ./drupal/drupal-$(DRUPAL_VERSION)/core/. ./public_html/core/
cp -rf ./drupal/drupal-$(DRUPAL_VERSION)/vendor/. ./public_html/vendor/
cp ./drupal/drupal-$(DRUPAL_VERSION)/*.* ./public_html/
cp ./drupal/drupal-$(DRUPAL_VERSION)/.??* ./public_html/
rm -rf backend
mkdir backend
cp -rf ./drupal/drupal-$(DRUPAL_VERSION)/modules ./backend/
cp -rf ./drupal/drupal-$(DRUPAL_VERSION)/profiles ./backend/
cp -rf ./drupal/drupal-$(DRUPAL_VERSION)/sites ./backend/
cp -rf ./drupal/drupal-$(DRUPAL_VERSION)/themes ./backend/
cp -rf ./drupal/drupal-$(DRUPAL_VERSION)/.htaccess ./backend/
cp -rf ./drupal/drupal-$(DRUPAL_VERSION)/robots.txt ./backend/
cp ./drupal/drupal-$(DRUPAL_VERSION)/example.gitignore ./backend/.gitignore
rm -rf drupal
cp -rf ./backend/modules ./public_html/
cp -rf ./backend/profiles ./public_html/
cp -rf ./backend/sites ./public_html/
cp -rf ./backend/themes ./public_html/
cp -rf ./backend/.htaccess ./public_html/
cp -rf ./backend/robots.txt ./public_html/
cp -rf ./backend/.gitignore ./public_html/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment