-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #983 from nextstrain/production-indexer
Always use production config.json in index-resources GH Action
- Loading branch information
Showing
4 changed files
with
21 additions
and
1 deletion.
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
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,16 @@ | ||
import { readFileSync } from "fs"; | ||
|
||
const PRODUCTION_CONFIG = "env/production/config.json"; | ||
const TESTING_CONFIG = "env/testing/config.json"; | ||
const RESOURCE_INDEX = "RESOURCE_INDEX"; | ||
|
||
const production_index = JSON.parse(readFileSync(PRODUCTION_CONFIG, 'utf8'))[RESOURCE_INDEX] | ||
const testing_index = JSON.parse(readFileSync(TESTING_CONFIG, 'utf8'))[RESOURCE_INDEX] | ||
|
||
if (production_index !== testing_index) { | ||
console.error(`ERROR: Please make sure ${PRODUCTION_CONFIG} and ${TESTING_CONFIG} have the same ${RESOURCE_INDEX}!"`) | ||
process.exit(1); | ||
} else { | ||
console.log(`Confirmed ${PRODUCTION_CONFIG} and ${TESTING_CONFIG} have the same ${RESOURCE_INDEX}`); | ||
process.exit(0); | ||
} |