Skip to content

Commit

Permalink
Update ignore build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
d0rich committed Nov 6, 2023
1 parent 8513b3f commit 13a290f
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 3 deletions.
14 changes: 14 additions & 0 deletions apps/d0rich.me/ignore-build.mjs
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion apps/d0rich.me/netlify.toml
Original file line number Diff line number Diff line change
@@ -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"
14 changes: 14 additions & 0 deletions apps/d0xigen.d0rich.me/ignore-build.mjs
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion apps/d0xigen.d0rich.me/netlify.toml
Original file line number Diff line number Diff line change
@@ -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"
13 changes: 13 additions & 0 deletions apps/design.d0rich.me/ignore-build.mjs
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion apps/design.d0rich.me/netlify.toml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 13a290f

Please sign in to comment.