Skip to content

Commit

Permalink
Adding hasSuccessExitCodes pipeline parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
krulis-martin committed Jul 18, 2024
1 parent c64ca8f commit 5744065
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/commands/runtimes/RuntimeImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ protected function configure()
'producesFiles' => 'boolean',
'hasEntryPoint' => 'boolean',
'hasExtraFiles' => 'boolean',
'hasSuccessExitCodes' => 'boolean',
],
];

Expand Down
1 change: 1 addition & 0 deletions app/model/entity/Pipeline.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public function overrideCreatedFrom(?Pipeline $pipeline): void
"producesFiles" => false,
"hasEntryPoint" => false,
"hasExtraFiles" => false,
"hasSuccessExitCodes" => false,
];

/**
Expand Down
14 changes: 14 additions & 0 deletions migrations/Version20240716161149.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ public function postUp(Schema $schema): void
"UPDATE pipeline_config SET pipeline_config = :config WHERE id = :id",
['id' => $pipeline['cid'], 'config' => Yaml::dump($config)]
);

// also add hasSuccessExitCodes pipeline parameter
$this->connection->executeQuery(
"INSERT INTO pipeline_parameter (id, pipeline_id, `name`, discriminator, boolean_value)
VALUES (UUID(), :id, 'hasSuccessExitCodes', 'booleanpipelineparameter', 1)",
['id' => $id]
);
}
}

Expand Down Expand Up @@ -223,6 +230,13 @@ public function postDown(Schema $schema): void
"UPDATE pipeline_config SET pipeline_config = :config WHERE id = :id",
['id' => $pipeline['cid'], 'config' => Yaml::dump($config)]
);

// also add hasSuccessExitCodes pipeline parameter
$this->connection->executeQuery(
"DELETE FROM pipeline_parameter WHERE pipeline_id = :id AND `name` = 'hasSuccessExitCodes'
AND discriminator = 'booleanpipelineparameter'",
['id' => $id]
);
}
}

Expand Down

0 comments on commit 5744065

Please sign in to comment.