cold-coat-35200
07/31/2019, 7:14 AMpulumi up
on the master branch without any change, it wants to delete all of my resources, looks like a caching issue with ts compiling, because I added log messages to the code and none of them appeared, deleted the code from index.ts and created only 1 resource, but after an up it only shows the old resource deletions, nothing about the new one, then I cloned our repo to a different directory, where pulumi works as expected, does not want change anything
I wasn't able to figure out how pulumi compiles my typescript files and where stores the compiled js files.
How can I solve this problem without deleting the whole git repo and clone again? (btw, I'm not sure that would be a solution in case if I clone to the same path)broad-dog-22463
07/31/2019, 7:41 AMcold-coat-35200
07/31/2019, 8:10 AMbroad-dog-22463
07/31/2019, 8:18 AMbroad-dog-22463
07/31/2019, 8:19 AMcold-coat-35200
07/31/2019, 9:19 AM"outDir": "bin",
, but I wasn't able to find a bin dir anywhere in my project treecold-coat-35200
07/31/2019, 9:58 AMdev.json
our main index file looks like this:
import * as pulumi from '@pulumi/pulumi'
import { RunError } from '@pulumi/pulumi/errors'
const stack = pulumi.getStack()
let output
if (stack === 'dlv-dev' || /^dlv-sbx([1-3])?$/.test(stack)) {
output = require('./dev')
} else if (stack === 'dlv-prod') {
output = require('./prod')
} else {
throw new RunError(`Invalid stack: ${stack}`)
}
module.exports = output
I changed require('./dev')
to require('./dev/index.ts')
and magically pulumi worked again, didn't want to delete everything, I became suspicious π
I added this console.log(require.resolve('./dev'))
to index.ts, the output: /home/ncsibra/dev/prmrgt-infra/pulumi/dliver/dev.json
π
Ok, that json file does not contain any resource definition, so pulumi was right about deleting everything π
After renaming dev.json
require
picked up the index.ts
file in the dev
folder, so pulumi saw my resource definitions again
Lesson learned, sorry about the false alarm πbroad-dog-22463
07/31/2019, 10:18 AM