sparse-intern-71089
09/02/2023, 7:07 PMimportant-leather-28796
09/02/2023, 7:36 PMlocal.Command
and see if I get the right lifecycle (after deployment rollout)
https://github.com/pulumi/pulumi-command/issues/7billowy-army-68599
important-leather-28796
09/02/2023, 8:33 PMimport { Web } from '@alienfast/pulumi-app'
import { local } from '@pulumi/command'
import { unsecret } from '@pulumi/pulumi'
import { apiKey, email, zoneId } from './cloudflare'
import { rules } from './pageRules'
export function purgeCache(web: Web) {
const cmd =
'node --experimental-specifier-resolution=node --loader ts-node/esm --no-warnings src/cmdPurgeCache.ts'
const urls = Object.keys(rules)
unsecret(apiKey).apply((key) => {
const cmdPurgeCache = new local.Command(
'cmdPurgeCache',
{
create: cmd,
update: cmd,
environment: {
'trigger-update': new Date().toISOString(),
EMAIL: email,
KEY: key,
ZONE_ID: zoneId,
URLS: urls.join(','),
},
},
{
dependsOn: [web],
},
)
})
}
important-leather-28796
09/02/2023, 8:34 PMenvironment: {
'trigger-update': new Date().toISOString(),
important-leather-28796
09/02/2023, 8:34 PMimportant-leather-28796
09/02/2023, 8:35 PMimportant-leather-28796
09/02/2023, 8:35 PMimportant-leather-28796
09/02/2023, 11:04 PMpulumi up -y --non-interactive --skip-preview