Skip to content

Commit

Permalink
#1 Fix install.
Browse files Browse the repository at this point in the history
  • Loading branch information
hkirsman committed Jun 27, 2024
1 parent 4d638a9 commit 085961a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,20 @@ GrumpPHP via Docker.

## Installation

1. Install wunderio/drupal-gitlab-local-pipelines Composer package:
1. Install wunderio/drupal-gitlab-local-pipelines Composer package using our Docker image:

```bash
docker run -v "$(pwd)":/app hkirsman/drupal-gitlab-local-pipelines:latest composer config --no-plugins allow-plugins.wunderio/drupal-gitlab-local-pipelines true
docker run -v "$(pwd)":/app wunderio/drupal-gitlab-local-pipelines composer require wunderio/drupal-gitlab-local-pipelines --dev
```

or use your local Composer:

```bash
composer config --no-plugins allow-plugins.wunderio/drupal-gitlab-local-pipelines true
composer require wunderio/drupal-gitlab-local-pipelines --dev
```

## Pushing Docker changes Docker Hub

1. Create image
Expand Down
14 changes: 5 additions & 9 deletions src/InstallHelperPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function onWunderIoDrupalGitlabLocalPipelinesPackageInstall(PackageEvent
return NULL;
}

self::deployDdevFiles();
self::deployDistFiles();
}

/**
Expand All @@ -128,24 +128,20 @@ public function onWunderIoDrupalGitlabLocalPipelinesPackageInstall(PackageEvent
* Composer package event sent on install/update/remove.
*/
public function onWunderIoDrupalGitlabLocalPipelinesPackageUpdate(PackageEvent $event) {
self::deployDdevFiles();
self::deployDistFiles();
}

/**
* Copy the config.wunderio.yaml file and the dist/ directory contents to the project.
*/
private function deployDdevFiles(): void {
private function deployDistFiles(): void {
$dest_dir = "{$this->projectDir}";

// Clean up old files from project root so we can deploy file removal.
// This is not ideal solution as we need to keep track of files to delete -
// basically this should cover everything that is in the dist/ directory.
$paths_to_delete = [
'.ddev/config.wunderio.yaml',
'.ddev/commands/web/wunderio-core-*',
'.ddev/wunderio/core/',
'.ddev/wunderio/custom/.gitignore',
'drush/sites/local.site.yml',
'.grumphp.yml',
];
foreach($paths_to_delete as $path) {
$full_delete_path = "{$dest_dir}/$path";
Expand All @@ -170,7 +166,7 @@ private function deployDdevFiles(): void {
}

// Copy contents of dist folder to project.
$dist_dir = "{$this->vendorDir}/" . self::PACKAGE_NAME . '/dist';
$dist_dir = "{$this->vendorDir}/" . self::PACKAGE_NAME;
self::rcopy($dist_dir, $dest_dir);
}

Expand Down

0 comments on commit 085961a

Please sign in to comment.