From d61066b414ac9b6e2bcf35e56e07af5c81c14ef8 Mon Sep 17 00:00:00 2001 From: verbral Date: Tue, 21 Nov 2017 15:28:23 +0100 Subject: [PATCH 1/3] Release 1.3.0 --- README.md | 23 +++--- .../post-install-cmd/install-nems-platform | 77 ------------------- resources/install-nems-platform.sh | 38 +++++++++ 3 files changed, 49 insertions(+), 89 deletions(-) delete mode 100755 resources/composer/scripts/post-install-cmd/install-nems-platform create mode 100755 resources/install-nems-platform.sh diff --git a/README.md b/README.md index e279543..3950221 100755 --- a/README.md +++ b/README.md @@ -1,15 +1,14 @@ ## NEMS Platform Instructions -To incorporate the NEMS platform into your subsite project you need to -copy the file `resources/composer/scripts/post-install-cmd/install-nems-platform` -to the same location into your subsite project. Make sure that this -file is executable. +To incorporate the nems platform into your subsite project you need to add the following to your resources/composer.json file: -This script will: -- install the nems platform source code into your projects `lib/` directory. -- it will add an include line into your site.make for its contributed modules. -- it will add a .gitignore file to your lib folder to exclude its source code. - -The script has the version set to ~1.0 which will allow for your project to -automatically update minor versions. If you wish to control the exact version -yourself you need to change the version in the script to the one you want. +```json { + "require": { + "ec-europa/ec-nems-platform": "~1.3.0" + }, + "scripts": { + "post-install-cmd": "vendor/ec-europa/ec-nems-platform/resources/install-nems-platform.sh", + "post-update-cmd": "vendor/ec-europa/ec-nems-platform/resources/install-nems-platform.sh" + } +} +``` diff --git a/resources/composer/scripts/post-install-cmd/install-nems-platform b/resources/composer/scripts/post-install-cmd/install-nems-platform deleted file mode 100755 index 0c90900..0000000 --- a/resources/composer/scripts/post-install-cmd/install-nems-platform +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash - - -# Set needed variables. -JSON="lib/composer.json" -MAKE="resources/site.make" -SCRIPT=$(basename $0) -TYPE=${SCRIPT#"install-"} -TYPE=${TYPE%"-platform"} -VERSION="~1.0" -GITIGNORE="lib/.gitignore" -IGNORES=( "vendor/" "*/$TYPE" "composer.lock" ) -FOLDERS=( "features" "libraries" "modules" ) - - -# Expand lib folder with $TYPE-platform. -if [ ! -e $JSON ] ; then - composer init --working-dir="lib" - composer require "ec-europa/ec-$TYPE-platform:$VERSION" --working-dir="lib" -elif grep -q "ec-europa/ec-$TYPE-platform" $JSON ; then - if [[ $VERSION == "~"* ]] ; then - rm lib/composer.lock - fi - composer install --working-dir="lib" -else - composer require "ec-europa/ec-$TYPE-platform:$VERSION" --working-dir="lib" -fi - - -# If the package is present update the lib source code. -if [ -d "lib/vendor/ec-europa/ec-$TYPE-platform" ] ; then - - # Rebuild $TYPE related sources. - rm -rf lib/*/$TYPE - - for FOLDER in "${FOLDERS[@]}" - do - # If platform provides the folder create it and copy sources. - if [ -d lib/vendor/ec-europa/ec-$TYPE-platform/lib/$FOLDER ] ; then - if ! [ -d lib/$FOLDER ] ; then - mkdir lib/$FOLDER - fi - mkdir -p lib/$FOLDER/$TYPE - cp -r lib/vendor/ec-europa/ec-$TYPE-platform/lib/$FOLDER/* lib/$FOLDER/$TYPE - fi - done - - # Copy the platform make file. - cp -f lib/vendor/ec-europa/ec-$TYPE-platform/resources/$TYPE-platform.make resources/$TYPE-platform.make - - - # Include the $TYPE-platform.make file. - if ! [ -e $MAKE ] 2> /dev/null && [ -e $MAKE".example" ] ; then - mv $MAKE".example" $MAKE; - elif [ -e $MAKE ] ; then - COMMENT="\n\n; =================" - COMMENT="$COMMENT\n; Platform for $TYPE" - COMMENT="$COMMENT\n; =================\n" - INCLUDE='includes[] = "'$TYPE'-platform.make"' - grep -qF "$INCLUDE" "$MAKE" || echo -e "$COMMENT$INCLUDE" >> "$MAKE" - else - echo "No site.make file found, $TYPE-platform.make not included!" - fi -fi - - -# Add gitignore to lib/ folder to avoid committing platform code. -if ! [ -e $GITIGNORE ] ; then - touch $GITIGNORE - echo -e "# Platform $TYPE code ignores.\n# ===========================" >> $GITIGNORE -fi -if [ -e $GITIGNORE ] ; then - for IGNORE in "${IGNORES[@]}" - do - grep -qF "$IGNORE" $GITIGNORE || echo -e "$IGNORE" >> $GITIGNORE - done -fi diff --git a/resources/install-nems-platform.sh b/resources/install-nems-platform.sh new file mode 100755 index 0000000..29ab93f --- /dev/null +++ b/resources/install-nems-platform.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +MAKE=../../../resources/site.make + +# If the package is present update the lib source code. +if [ -d "vendor/ec-europa/ec-nems-platform" ] ; then + + # Remove nems related sources if any. + rm -rf modules/features/nems + #rm -rf modules/custom/nems + #rm -rf themes/nems + + # Create clean folders + mkdir -p modules/features/nems + #mkdir -p modules/custom/nems + #mkdir -p themes/nems + + # Copy the sources in place. + cp -r vendor/ec-europa/ec-nems-platform/lib/features/* modules/features/nems + #cp -r vendor/ec-europa/ec-nems-platform/lib/modules/* modules/custom/nems + #cp -r vendor/ec-europa/ec-nems-platform/lib/themes/* themes/nems + cp -f vendor/ec-europa/ec-nems-platform/resources/nems-platform.make ../../../resources/nems-platform.make + + # Include the nems-platform.make file. + if ! [ -e $MAKE ] 2> /dev/null && [ -e $MAKE".example" ] ; then + mv $MAKE".example" $MAKE; + fi + if [ -e $MAKE ] ; then + COMMENT="\n\n; =================" + COMMENT="$COMMENT\n; Platform for nems" + COMMENT="$COMMENT\n; =================\n" + INCLUDE='includes[] = "nems-platform.make"' + grep -qF "$INCLUDE" "$MAKE" || echo -e "$COMMENT$INCLUDE" >> "$MAKE" + else + echo "No $MAKE file found, nems-platform.make not included!" + fi +fi + From 1cc6937138887a0b627e635ab183a036034f23e2 Mon Sep 17 00:00:00 2001 From: verbruggenalex Date: Tue, 21 Nov 2017 15:41:10 +0100 Subject: [PATCH 2/3] Update nems-platform.make --- resources/nems-platform.make | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/nems-platform.make b/resources/nems-platform.make index 63d8cf0..6dcef86 100644 --- a/resources/nems-platform.make +++ b/resources/nems-platform.make @@ -1,3 +1,6 @@ +api = 2 +core = 7.x + ; =================== ; Contributed modules ; =================== From ffa13e4286d5ea69316403fc6b75ab4f2a7d39d3 Mon Sep 17 00:00:00 2001 From: Alexander Verbruggen Date: Wed, 14 Feb 2018 15:06:49 +0100 Subject: [PATCH 3/3] MULTISITE-19408: Adding corrected license information. --- LICENSE.md => LICENSE.txt | 0 composer.json | 1 + 2 files changed, 1 insertion(+) rename LICENSE.md => LICENSE.txt (100%) diff --git a/LICENSE.md b/LICENSE.txt similarity index 100% rename from LICENSE.md rename to LICENSE.txt diff --git a/composer.json b/composer.json index 443adb9..15d0ede 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,7 @@ { "name": "ec-europa/ec-nems-platform", "description": "Modules, features and theme sourcecode for the nems platform", + "license": "EUPL-1.1", "require": { "php": ">=5.4.0" }