Skip to content

Commit

Permalink
add rootless rsync commands to drush rsync task
Browse files Browse the repository at this point in the history
With rootless systems running a normal `drush rsync` command causes some issues as rootless systems (like openshift or k8s rootless) do not allow the executing user to do some of the standard things that rsync wants to do (change owner and group to what the source had).
Therefore we tell `drush rsync` to run `rsync` with some additional parameters that will prevent it to fail
  • Loading branch information
Schnitzel authored Mar 24, 2022
1 parent 3d1c7a2 commit f22ce91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion services/api/src/resources/task/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ export const taskDrushRsyncFiles: ResolverFn = async (
const command =
`LAGOON_ALIAS_PREFIX="" && \
if [[ ! "" = "$(drush | grep 'lagoon:aliases')" ]]; then LAGOON_ALIAS_PREFIX="lagoon.\${LAGOON_PROJECT}-"; fi && \
drush -y rsync @\${LAGOON_ALIAS_PREFIX}${sourceEnvironment.name}:%files @self:%files`;
drush -y rsync @\${LAGOON_ALIAS_PREFIX}${sourceEnvironment.name}:%files @self:%files -- --omit-dir-times --no-perms --no-group --no-owner --chmod=ugo=rwX`;

const taskData = await Helpers(sqlClientPool).addTask({
name: `Sync files ${sourceEnvironment.name} -> ${destinationEnvironment.name}`,
Expand Down

0 comments on commit f22ce91

Please sign in to comment.