For the local development environment we have commands like ahoy live pull* and they use drush commands for download and sync. While drush works remotely in general, file operations in a remote docker container are not yet supported.
We also provide ChatOp commands to trigger pipelines that build that data as artefacts. They will have the same issues.
The CI pipelines require access to the same data too when tests are enabled.
Let's implement a solution that works in remote docker containers and don't require SSH so that all developers can use them, even without access to the host's console.
As a quick win for our local dev environment - and therefore maybe even for the pipelines - we can use the docker-compose support from Drush. This requires the following adjustments:
Those should be defined in the same way with the docker specification as for the default. This then requires an extra option --context remote
/usr/local/bin/drush
This should be simplified and call /drupal/vendor/bin/drush with all the given arguments from the command line. If no alias is provided, add the default alias.
/usr/local/bin/docker-compose
This should check for the context argument and put that onto the docker command.
#!/bin/bashACTIVE=0CONTEXT=defaultARGS=''for arg in "$@"; do if [[ $arg == '--context' ]]; then ACTIVE=1 elif [[ ACTIVE -eq 1 ]]; then CONTEXT=$arg ACTIVE=0 else ARGS="${ARGS} ${arg}" fidonedocker --context $CONTEXT compose $ARGSEC=$?exit $EC
Docker context
When starting l3d, create docker contexts for the current project and all of its stages.
The following ChatOps commands are now implemented:
# Collect DB from main site/KEYWORD run CollectDatabase# Collect files from main site/KEYWORD run CollectFiles# Copy data (db and files) from source branch to target branch/KEYWORD run CopyDataToStage SOURCEBRANCH TARGETBRANCH# Reset locales on BRANCH/KEYWORD run ResetLocales BRANCH