Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

Commit

Permalink
3.4.0 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
phenaproxima committed Dec 11, 2019
1 parent dbe2d54 commit 8957b30
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 27 deletions.
3 changes: 3 additions & 0 deletions UPDATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ are currently running 2.2.0 and are trying to update to 2.2.6, you will need to
follow the instructions for updating from 2.2.0 to 2.2.1, then from 2.2.1 to
2.2.2, in that order.

## 3.3.4 to 3.4.0
There are no manual update steps for this version.

## 3.3.3 to 3.3.4
There are no manual update steps for this version.

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"ln -s -f git-hooks/pre-commit .git/hooks/pre-commit",
"@composer package"
],
"configure-tarball": "Acquia\\Lightning\\Composer\\ConfigureLegacyProject::execute",
"drupal-scaffold": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold",
"enable-asset-packagist": "Acquia\\Lightning\\Composer\\AssetPackagist::execute",
"nuke": "rm -r -f docroot vendor",
Expand Down
16 changes: 8 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions src/Composer/ConfigureLegacyProject.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace Acquia\Lightning\Composer;

use Composer\Json\JsonFile;
use Composer\Script\Event;

/**
* Configures an instance of drupal/legacy-project to install Lightning.
*/
final class ConfigureLegacyProject {

/**
* Executes the script.
*
* @param \Composer\Script\Event $event
* The script event.
*/
public static function execute(Event $event) {
$arguments = $event->getArguments();

$target = new JsonFile($arguments[0] . '/composer.json');
$project = $target->read();

$required = $event->getComposer()->getPackage()->getRequires();
$components = [
'api',
'core',
'media',
'layout',
'workflow',
];
foreach ($components as $component) {
$project['require']["drupal/lightning_$component"] = $required["drupal/lightning_$component"]->getPrettyConstraint();
}
$project['repositories'][] = [
'type' => 'composer',
'url' => 'https://asset-packagist.org',
];
$project['extra']['installer-paths']['libraries/{$name}'] = [
'type:drupal-library',
'type:bower-asset',
'type:npm-asset',
];
$project['extra']['installer-types'] = ['bower-asset', 'npm-asset'];
$project['extra']['patchLevel']['drupal/core'] = '-p2';

$target->write($project);
}

}
31 changes: 12 additions & 19 deletions tarball.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

DESTINATION=`pwd`
WORK_DIR=/tmp
ARCHIVE=lightning-8.x-$1
PROFILE_DIR=profiles/contrib/lightning
YAML_CLI=`command -v yaml-cli`
Expand All @@ -13,31 +11,26 @@ if [[ ! $YAML_CLI ]]; then
exit 1
fi

# Generate the Drush make file we will use to build the tarball.
composer package 1> $WORK_DIR/cloud.make
composer create-project --stability beta --no-install drupal/legacy-project:~8.8.0 $ARCHIVE
composer dump-autoload
composer configure-tarball $ARCHIVE

# Update version number in info files.
find . -name "*.info.yml" -exec $YAML_CLI update:value {} version 8.x-$1 \;

# Create an archive of the profile to be added to the tarball.
composer archive --file $ARCHIVE --dir $WORK_DIR
composer archive --file $ARCHIVE

# Remove modifications to info files.
git reset --hard

# Switch to a scratch directory.
cd $WORK_DIR

# Download Drush 8, which has the make command, and make it executable.
curl -L -o drush https://github.com/drush-ops/drush/releases/download/8.1.16/drush.phar
chmod +x drush

# Build the code base from the generated make file.
./drush make cloud.make $ARCHIVE

# Add required Composer dependencies.
cd $ARCHIVE
composer require j7mbo/twitter-api-php league/oauth2-server:~6.0 webflo/drupal-core-strict:~8.7.0 'phpdocumentor/reflection-docblock:^3.0||^4.0'
composer config extra.enable-patching true
composer config minimum-stability dev
composer config prefer-stable true
composer remove --no-update composer/installers
composer require --no-update "ext-dom:*" cweagans/composer-patches oomphinc/composer-installers-extender
composer update

# Create the profile destination directory.
mkdir -p $PROFILE_DIR
Expand All @@ -47,7 +40,7 @@ tar -x -f ../$ARCHIVE.tar --directory $PROFILE_DIR
cd ..

# Wrap it all up in a nice compressed tarball.
tar --exclude='.DS_Store' --exclude='._*' -c -z -f $DESTINATION/$ARCHIVE.tar.gz $ARCHIVE
tar --exclude='.DS_Store' --exclude='._*' -c -z -f $ARCHIVE.tar.gz $ARCHIVE

# Clean up.
rm -r -f drush $ARCHIVE.tar $ARCHIVE cloud.make
rm -r -f $ARCHIVE.tar $ARCHIVE
Binary file modified tests/fixtures/3.3.4.php.gz
Binary file not shown.
Binary file added tests/fixtures/3.4.0.php.gz
Binary file not shown.

0 comments on commit 8957b30

Please sign in to comment.