From 13a290f5d96b395e3367b87d9c7fe6709747b463 Mon Sep 17 00:00:00 2001 From: Nikolay Dorofeev Date: Mon, 6 Nov 2023 11:35:29 +0400 Subject: [PATCH] Update ignore build scripts --- apps/d0rich.me/ignore-build.mjs | 14 ++++++++++++++ apps/d0rich.me/netlify.toml | 2 +- apps/d0xigen.d0rich.me/ignore-build.mjs | 14 ++++++++++++++ apps/d0xigen.d0rich.me/netlify.toml | 2 +- apps/design.d0rich.me/ignore-build.mjs | 13 +++++++++++++ apps/design.d0rich.me/netlify.toml | 2 +- 6 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 apps/d0rich.me/ignore-build.mjs create mode 100644 apps/d0xigen.d0rich.me/ignore-build.mjs create mode 100644 apps/design.d0rich.me/ignore-build.mjs diff --git a/apps/d0rich.me/ignore-build.mjs b/apps/d0rich.me/ignore-build.mjs new file mode 100644 index 00000000..af369a34 --- /dev/null +++ b/apps/d0rich.me/ignore-build.mjs @@ -0,0 +1,14 @@ +import { execSync } from 'child_process' + +const cachedCommitRef = process.env.CACHED_COMMIT_REF || 'd06423d365fa9cf3ef99a8653abbf1a83fe7d3bb' +const commitRef = process.env.COMMIT_REF || 'HEAD' + +const changesList = execSync(`git diff --name-only ${cachedCommitRef} ${commitRef}`).toString() + +const isD0richMeChanged = changesList.includes('apps/d0rich.me') +const isNuxtContentMermaidChanged = changesList.includes('packages/nuxt-content-mermaid') +const isNuxtDesignSystemChanged = changesList.includes('packages/nuxt-design-system') + +const ignoreBuild = !isD0richMeChanged && !isNuxtContentMermaidChanged && !isNuxtDesignSystemChanged + +process.exit(ignoreBuild ? 0 : 1) diff --git a/apps/d0rich.me/netlify.toml b/apps/d0rich.me/netlify.toml index b9a4b6e2..8f5d5eb6 100644 --- a/apps/d0rich.me/netlify.toml +++ b/apps/d0rich.me/netlify.toml @@ -1,2 +1,2 @@ [build] - ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF || git diff ../../packages/nuxt-content-mermaid --quiet $CACHED_COMMIT_REF $COMMIT_REF || git diff ../../packages/nuxt-design-system --quiet $CACHED_COMMIT_REF $COMMIT_REF" + ignore = "node apps/d0rich.me/ignore-build.mjs" diff --git a/apps/d0xigen.d0rich.me/ignore-build.mjs b/apps/d0xigen.d0rich.me/ignore-build.mjs new file mode 100644 index 00000000..d9350abc --- /dev/null +++ b/apps/d0xigen.d0rich.me/ignore-build.mjs @@ -0,0 +1,14 @@ +import { execSync } from 'child_process' + +const cachedCommitRef = process.env.CACHED_COMMIT_REF || 'd06423d365fa9cf3ef99a8653abbf1a83fe7d3bb' +const commitRef = process.env.COMMIT_REF || 'HEAD' + +const changesList = execSync(`git diff --name-only ${cachedCommitRef} ${commitRef}`).toString() + +const isD0xigenD0richMeChanged = changesList.includes('apps/d0xigen.d0rich.me') +const isNuxtContentMermaidChanged = changesList.includes('packages/nuxt-content-mermaid') +const isNuxtDesignSystemChanged = changesList.includes('packages/nuxt-design-system') + +const ignoreBuild = !isD0xigenD0richMeChanged && !isNuxtContentMermaidChanged && !isNuxtDesignSystemChanged + +process.exit(ignoreBuild ? 0 : 1) diff --git a/apps/d0xigen.d0rich.me/netlify.toml b/apps/d0xigen.d0rich.me/netlify.toml index e748f312..0d6ca3de 100644 --- a/apps/d0xigen.d0rich.me/netlify.toml +++ b/apps/d0xigen.d0rich.me/netlify.toml @@ -1,2 +1,2 @@ [build] - ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF || git diff ../../packages/d0xigen --quiet $CACHED_COMMIT_REF $COMMIT_REF || git diff ../../packages/nuxt-content-mermaid --quiet $CACHED_COMMIT_REF $COMMIT_REF || git diff ../../packages/nuxt-design-system --quiet $CACHED_COMMIT_REF $COMMIT_REF" + ignore = "node apps/d0xigen.d0rich.me/ignore-build.mjs" diff --git a/apps/design.d0rich.me/ignore-build.mjs b/apps/design.d0rich.me/ignore-build.mjs new file mode 100644 index 00000000..fa366d98 --- /dev/null +++ b/apps/design.d0rich.me/ignore-build.mjs @@ -0,0 +1,13 @@ +import { execSync } from 'child_process' + +const cachedCommitRef = process.env.CACHED_COMMIT_REF || 'd06423d365fa9cf3ef99a8653abbf1a83fe7d3bb' +const commitRef = process.env.COMMIT_REF || 'HEAD' + +const changesList = execSync(`git diff --name-only ${cachedCommitRef} ${commitRef}`).toString() + +const isDesignD0richMeChanged = changesList.includes('apps/design.d0rich.me') +const isNuxtDesignSystemChanged = changesList.includes('packages/nuxt-design-system') + +const ignoreBuild = !isDesignD0richMeChanged && !isNuxtDesignSystemChanged + +process.exit(ignoreBuild ? 0 : 1) diff --git a/apps/design.d0rich.me/netlify.toml b/apps/design.d0rich.me/netlify.toml index e3a1cfe2..fb7219e5 100644 --- a/apps/design.d0rich.me/netlify.toml +++ b/apps/design.d0rich.me/netlify.toml @@ -1,2 +1,2 @@ [build] - ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF || git diff ../../packages/nuxt-design-system --quiet $CACHED_COMMIT_REF $COMMIT_REF" + ignore = "node apps/design.d0rich.me/ignore-build.mjs"