Skip to content

Commit

Permalink
Group vendor pull commands in Atmos workflow steps
Browse files Browse the repository at this point in the history
  • Loading branch information
milldr committed Jan 10, 2025
1 parent 07b8ecb commit 4682639
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/components/AtmosWorkflow/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,22 @@ export async function GetAtmosTerraformCommands(
}
};

// Group all vendor pull commands together
const isVendorWorkflow = workflowDetails.steps.every(step =>
step.command.startsWith('vendor pull')
);

for (const step of workflowDetails.steps) {
let command = step.command;

if (command.trim().startsWith('echo') && step.type === 'shell') {
if (isVendorWorkflow) {
// Add all vendor commands to a single group
let atmosCommand = `atmos ${command}`;
if (stack) {
atmosCommand += ` -s ${stack}`;
}
currentGroupCommands.push(atmosCommand);
} else if (command.trim().startsWith('echo') && step.type === 'shell') {
// When we find an echo, add previous group (if any) and start new group
addGroupToSteps();
// Store the echo text as the current title
Expand Down
1 change: 0 additions & 1 deletion utils.ts

This file was deleted.

0 comments on commit 4682639

Please sign in to comment.