diff --git a/assets/dev-env.lando.template.yml.ejs b/assets/dev-env.lando.template.yml.ejs index b7ab57bac..d94a42d37 100644 --- a/assets/dev-env.lando.template.yml.ejs +++ b/assets/dev-env.lando.template.yml.ejs @@ -19,7 +19,6 @@ services: type: compose services: image: ghcr.io/automattic/vip-container-images/dev-tools:0.9 - command: /bin/true volumes: - devtools:/dev-tools - scripts:/scripts @@ -31,6 +30,7 @@ services: devtools: {} scripts: initOnly: true + entrypoint: sh -c 'test -d /dev-tools-orig && /usr/bin/rsync -a --delete /dev-tools-orig/ /dev-tools/ || true' nginx: type: compose @@ -66,6 +66,17 @@ services: <% } %> LANDO_NO_USER_PERMS: 'enable' LANDO_NEEDS_EXEC: 1 + depends_on: + database: + condition: service_started + memcached: + condition: service_started +<% if ( elasticsearch ) { %> + elasticsearch: + condition: service_started +<% } %> + devtools: + condition: service_completed_successfully volumes: - type: volume source: devtools diff --git a/src/lib/constants/dev-environment.ts b/src/lib/constants/dev-environment.ts index a00b9979f..196c86fb7 100644 --- a/src/lib/constants/dev-environment.ts +++ b/src/lib/constants/dev-environment.ts @@ -49,4 +49,4 @@ export const DEV_ENVIRONMENT_DEFAULTS = { phpVersion: Object.keys( DEV_ENVIRONMENT_PHP_VERSIONS )[ 0 ], } as const; -export const DEV_ENVIRONMENT_VERSION = '2.1.2'; +export const DEV_ENVIRONMENT_VERSION = '2.1.3'; diff --git a/src/lib/dev-environment/dev-environment-lando.ts b/src/lib/dev-environment/dev-environment-lando.ts index 0d6c7090f..7a0baea0d 100644 --- a/src/lib/dev-environment/dev-environment-lando.ts +++ b/src/lib/dev-environment/dev-environment-lando.ts @@ -285,8 +285,6 @@ export async function landoRebuild( lando: Lando, instancePath: string ): Promis const app = await getLandoApplication( lando, instancePath ); - app.events.on( 'post-uninstall', async () => removeDevToolsVolumes( lando, app ) ); - await ensureNoOrphantProxyContainer( lando ); await app.rebuild(); } finally { @@ -704,30 +702,6 @@ export async function landoShell( } ); } -/** - * Dev-tools volumes can get stale and is not updated when the new version of dev-tools - * image is installed. Removing it during rebuild ensures the content is freshly populated - * on startup. - * - * @param {Lando} lando - * @param {App} app - */ -async function removeDevToolsVolumes( lando: Lando, app: App ) { - debug( 'Attempting to removing dev-tools volumes' ); - - const scanResult = await lando.engine.docker.listVolumes(); - const devToolsVolumeNames = scanResult.Volumes.map( volume => volume.Name ) - // eslint-disable-next-line security/detect-non-literal-regexp - .filter( volumeName => new RegExp( `${ app.project }.*devtools` ).test( volumeName ) ); - - debug( 'Will remove', devToolsVolumeNames ); - - const removalPromises = devToolsVolumeNames.map( volumeName => - removeVolume( lando, volumeName ) - ); - await Promise.all( removalPromises ); -} - /** * Remove volume */