From 69a6b1daaa3933b8d32758cc31e968f5cb0efbec Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Wed, 4 Sep 2024 15:58:47 -0400 Subject: [PATCH] fix issue with recipe builder tasks not persisting across rebuilds --- CHANGELOG.md | 8 ++++++++ bin/lando | 15 +++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9186a43e..b77fcad6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) +### New Features + +* Updated `@lando/core` to [`v3.22.0-beta.6`](https://github.com/lando/core/releases/tag/v3.22.0-beta.6) + +### Bug Fixes + +* Fixed bug causing recipe builder `tasks` to not persist across rebuilds + ## v3.22.0-beta.5 - [September 4, 2024](https://github.com/lando/cli/releases/tag/v3.22.0-beta.5) * Updated `@lando/core` to [`v3.22.0-beta.5`](https://github.com/lando/core/releases/tag/v3.22.0-beta.5) diff --git a/bin/lando b/bin/lando index 429f3e6f6..06d2e36aa 100755 --- a/bin/lando +++ b/bin/lando @@ -155,20 +155,27 @@ if (runtime === 4) { // Summon the implementation of @lando/cli@3 that works with @lando/core@3 const Cli = require('../lib/cli'); const cli = new Cli(ENVPREFIX, LOGLEVELCONSOLE, USERCONFROOT, COREBASE, debug); - const bsLevel = !_.isEmpty(appConfig) && !fs.existsSync(appConfig.composeCache) ? 'APP' : 'TASKS'; const getTasks = require(`${COREBASE}/utils/get-tasks`); debug('starting lando with %o runtime using cli %o', `v${runtime}`, {ENVPREFIX, LOGLEVELCONSOLE, USERCONFROOT, COREBASE}); + // Check for sudo usage + cli.checkPerms(); + // Lando cache stuffs process.lando = 'node'; process.landoTaskCacheName = '_.tasks.cache'; process.landoTaskCacheFile = path.join(cli.defaultConfig().userConfRoot, 'cache', process.landoTaskCacheName); process.landoAppCacheFile = !_.isEmpty(appConfig) ? appConfig.composeCache : undefined; - // Check for sudo usage - cli.checkPerms(); + // Check for a recipe cache and enforce manual app tasks cache clear if applicable + if (appConfig.recipe && !fs.existsSync(appConfig.recipeCache)) { + if (fs.existsSync(process.landoAppCacheFile)) fs.unlinkSync(process.landoAppCacheFile); + } + + // determine bs level + const bsLevel = !_.isEmpty(appConfig) && !fs.existsSync(process.landoAppCacheFile) ? 'APP' : 'TASKS'; - // Check to see if we have a recipe and if it doesn't have a tooling cache lets enforce a manual cache clear + // Check to see if we have a compose cache and if we dont then lets enforce a manual lando tasks cache clear if (bsLevel === 'APP' && !fs.existsSync(appConfig.composeCache)) { if (fs.existsSync(process.landoTaskCacheFile)) fs.unlinkSync(process.landoTaskCacheFile); }