diff --git a/prepareLocally.sh b/bin/prepareLocally.sh similarity index 100% rename from prepareLocally.sh rename to bin/prepareLocally.sh diff --git a/bin/spoon b/bin/spoon new file mode 100755 index 0000000000000000000000000000000000000000..79bb52d928b405d4695d42d53956ccf74dccf070 --- /dev/null +++ b/bin/spoon @@ -0,0 +1,6 @@ +#!/bin/bash + +COMPOSER=composer.spoons.json +export COMPOSER + +composer $@ diff --git a/composer.json b/composer.json index 7d7e72e13da7fe99241569092596778f3951b1b6..798dbf0e3c1b3d5e8cc21373b79912ce55e7b2af 100644 --- a/composer.json +++ b/composer.json @@ -28,6 +28,9 @@ "LakeDrops\\DrupalSpoons\\": "src/" } }, + "bin": [ + "bin/spoon" + ], "extra": { "class": "LakeDrops\\DrupalSpoons\\Plugin" }, diff --git a/src/Handler.php b/src/Handler.php index dbff5645ee58f71bcea7dbbce354e0a6f760b1f7..97b1be206df3a0e6e3a68ac2014bff811620ed19 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -14,6 +14,8 @@ use Symfony\Component\Filesystem\Filesystem; */ class Handler { + const DRUPAL_SPOONS_VERSION = '1.7.0-rc1'; + /** * The composer object of this session. * @@ -98,6 +100,12 @@ class Handler { $fs->symlink($rel . $item, $moduleRoot . "/$item"); } } + + // Prepare GitLab CI file. + $gitlabCiFile = $projectRoot . '/.gitlab-ci.yml'; + if (!$fs->exists($gitlabCiFile)) { + $fs->dumpFile($gitlabCiFile, $this->defaultGitLabCi()); + } } /** @@ -187,4 +195,19 @@ class Handler { ]; } + /** + * Get default GitLab CI instructions for DrupalSpoons. + * + * @return string + */ + protected function defaultGitLabCi(): string { + $version = self::DRUPAL_SPOONS_VERSION; + return <<<gitlabci +include: + - project: 'drupalspoons/webmasters' + ref: $version + file: 'templates/.gitlab-ci.yml' +gitlabci; + } + }