-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e52efdf
commit e3fcc88
Showing
10 changed files
with
113 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DATOCMS_ACCOUNT_EMAIL="" | ||
DATOCMS_ACCOUNT_PASSWORD="" | ||
DATOCMS_ORGANIZATION_ID="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import 'dotenv/config'; | ||
import { ApiError } from '../packages/dashboard-client'; | ||
import { generateNewDashboardClient } from './generateNewDashboardClient'; | ||
|
||
export default async () => { | ||
const client = await generateNewDashboardClient(); | ||
|
||
const siteIds: string[] = []; | ||
|
||
for await (const site of client.sites.listPagedIterator()) { | ||
siteIds.push(site.id); | ||
} | ||
|
||
await Promise.all( | ||
siteIds.map(async (id) => { | ||
try { | ||
await client.sites.destroy(id); | ||
} catch (e) { | ||
if (e instanceof ApiError && e.findError('NOT_FOUND')) { | ||
// NOP: If multiple processes are running tests in parallel (like in Github Actions) | ||
// other processes might have already deleted the project. It's fine, move on. | ||
return; | ||
} | ||
|
||
throw e; | ||
} | ||
}), | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters