Skip to content
Snippets Groups Projects

Issue #3194036: Check for a .tugboat/config.yml file on contrib modules

Merged Issue #3194036: Check for a .tugboat/config.yml file on contrib modules
All threads resolved!
Compare and
12 files
+ 882
282
Compare changes
  • Side-by-side
  • Inline

Files

+ 8
42
@@ -80,14 +80,15 @@ function drupalorg_drush_command() {
'drupalorg-tugboat-register-project' => [
'description' => 'Registers a project at Tugboat',
'arguments' => [
'project_name' => 'The project name, like drupal for Drupal core.',
'project_namespace' => 'The project namespace, like project.',
'project_name' => 'The project name, like drupal.',
],
],
'drupalorg-tugboat-build-base-preview' => [
'description' => 'Builds a base preview for a project and branch',
'arguments' => [
'project_id' => 'The project identifier at https://dashboard.tugboat.qa',
'project_name' => 'The project name, like drupal for Drupal core',
'project_name' => 'The project name, like drupal for Drupal core. This is used to pick a configuration from https://github.com/TugboatQA/drupalorg.',
'branch' => 'The branch to build as a base preview',
],
],
@@ -1025,47 +1026,12 @@ function drush_drupalorg_repath_docs($nid) {
/**
* Registers a project at Tugboat.
*/
function drush_drupalorg_tugboat_register_project($project_name) {
$gitlab_token = variable_get('tugboat_gitlab_api_token');
$body = [
'project' => variable_get('tugboat_project_id'),
'provider' => [
'name' => 'gitlab',
'address' => drupalorg_gitlab_url_with_htauth(),
],
'repository' => [
'name' => $project_name,
'group' => 'project'
],
'auth' => [
'token' => $gitlab_token,
],
'autobuild' => FALSE,
'autodelete' => TRUE,
'autorebuild' => TRUE,
'build_timeout' => 3600,
'name' => 'project/' . $project_name,
'provider_comment' => TRUE,
'provider_deployment' => TRUE,
'provider_forks' => TRUE,
'provider_status' => TRUE,
'quota' => 0,
'refresh_anchors' => TRUE,
'refresh_day' => 7,
'refresh_hour' => 0,
'rebuild_orphaned' => FALSE,
'rebuild_stale' => FALSE,
];
function drush_drupalorg_tugboat_register_project($project_namespace, $project_name) {
try {
$response = Tugboat::getClient()->request('POST', '/v3/repos', [
'headers' => ['Content-Type' => 'application/json'],
'body' => json_encode($body),
]);
$response = TugboatApi::registerRepository($project_namespace, $project_name);
drush_log(dt('Response is: !response', [
'!response' => $response->getBody()->__toString(),
]), LogLevel::OK);
]), LogLevel::OK);
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
drush_log(dt('Bad response: @message', [
@@ -1083,7 +1049,7 @@ function drush_drupalorg_tugboat_register_project($project_name) {
* Builds a base preview for a Tugboat project.
*/
function drush_drupalorg_tugboat_build_base_preview($project_id, $project_name, $branch) {
$tugboat_configuration = DrupalorgIssueFork::getTugboatConfiguration($project_name, $branch);
$tugboat_configuration = TugboatPreview::fetchConfiguration($project_name, $branch);
if (empty($tugboat_configuration)) {
drush_log(dt('Could not fetch Tugboat configuration for such project and branch.'), LogLevel::ERROR);
@@ -1101,7 +1067,7 @@ function drush_drupalorg_tugboat_build_base_preview($project_id, $project_name,
];
try {
$response = Tugboat::getClient()->request('POST', '/v3/previews', [
$response = TugboatApi::getClient()->request('POST', '/v3/previews', [
'headers' => ['Content-Type' => 'application/json'],
'body' => json_encode($body),
]);
Loading