Skip to content

Commit 137d805

Browse files
committed
Merge branch 'develop'
Merge details: commit c8f0df3 Author: Jelle Sebreghts <sebreghts.jelle@gmail.com> Date: Tue Oct 28 14:24:40 2025 Add post sync tasks to the task collection
2 parents 7508095 + c8f0df3 commit 137d805

File tree

2 files changed

+26
-22
lines changed

2 files changed

+26
-22
lines changed

src/Traits/CommandWithBackups.php

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -84,28 +84,6 @@ protected function restoreBackupRemoteTask(RemoteConfig $remoteConfig, $backupOp
8484
);
8585
}
8686

87-
/**
88-
* Get the task that will run after syncing remotes.
89-
*
90-
* @param RemoteConfig $remoteConfig
91-
* RemoteConfig object populated with data relevant to the host.
92-
* @param array $opts
93-
* Extra options passed to the sync command.
94-
*
95-
* @return \Robo\Contract\TaskInterface
96-
*/
97-
protected function postSyncRemoteTask(RemoteConfig $remoteConfig, $opts)
98-
{
99-
return $this->handleTaskEvent(
100-
'digipolis:post-sync-remote',
101-
[
102-
'remoteConfig' => $remoteConfig,
103-
'fileBackupConfig' => $this->getFileBackupConfig(),
104-
'options' => $opts,
105-
]
106-
);
107-
}
108-
10987
/**
11088
* Get the task that will download a backup from a host.
11189
*

src/Traits/DigipolisHelpersSyncCommandUtilities.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ public function sync(
107107
$collection->addTask(
108108
$this->restoreBackupRemoteTask($destinationRemoteConfig, $opts)
109109
);
110+
// Execute post sync tasks.
111+
$collection->addTask(
112+
$this->postSyncRemoteTask($destinationRemoteConfig, $opts)
113+
);
110114
// Remove the backup from the destination host.
111115
$collection->completion(
112116
$this->removeBackupRemoteTask($destinationRemoteConfig, $opts)
@@ -169,4 +173,26 @@ protected function removeLocalBackupTask(RemoteConfig $remoteConfig, $options)
169173
]
170174
);
171175
}
176+
177+
/**
178+
* Get the task that will run after syncing remotes.
179+
*
180+
* @param RemoteConfig $remoteConfig
181+
* RemoteConfig object populated with data relevant to the host.
182+
* @param array $opts
183+
* Extra options passed to the sync command.
184+
*
185+
* @return \Robo\Contract\TaskInterface
186+
*/
187+
protected function postSyncRemoteTask(RemoteConfig $remoteConfig, $opts)
188+
{
189+
return $this->handleTaskEvent(
190+
'digipolis:post-sync-remote',
191+
[
192+
'remoteConfig' => $remoteConfig,
193+
'fileBackupConfig' => $this->getFileBackupConfig(),
194+
'options' => $opts,
195+
]
196+
);
197+
}
172198
}

0 commit comments

Comments
 (0)