Skip to content
Snippets Groups Projects
Commit fe52052a authored by jurgenhaas's avatar jurgenhaas
Browse files

Further improvements around scripting

Create .gitlab-ci.yml if not yet present
parent fd709606
No related branches found
No related tags found
No related merge requests found
File moved
#!/bin/bash
COMPOSER=composer.spoons.json
export COMPOSER
composer $@
......@@ -28,6 +28,9 @@
"LakeDrops\\DrupalSpoons\\": "src/"
}
},
"bin": [
"bin/spoon"
],
"extra": {
"class": "LakeDrops\\DrupalSpoons\\Plugin"
},
......
......@@ -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;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment