[next] Docker + Revision Metadata (#1991)

* feat: added version metadata, release to Docker

* fix: fixed mistake with export

* fix: adjusted circle cache beheviour

* fix: removed node_modules from workspace

* fix: added version prefix to cache keys

* review: patched invalid job name

* fix: hardcode cache version prefix :(

* fix: improved cache keys
This commit is contained in:
Wyatt Johnson
2018-10-12 19:13:55 +00:00
committed by GitHub
parent ba15cbf23c
commit cda72ba249
12 changed files with 77 additions and 20 deletions
+16
View File
@@ -0,0 +1,16 @@
import fs from "fs";
import path from "path";
export let revision: string = "";
export let version: string = "";
// Pull the version information from the package.json file.
const packagePath = path.join(__dirname, "..", "..", "..", "package.json");
({ version } = JSON.parse(fs.readFileSync(packagePath, "utf8")));
// Try to get the revision from the revision file. This file is generated by the
// Docker build.
const revisionPath = path.join(__dirname, "__generated__", "revision.json");
if (fs.existsSync(revisionPath)) {
({ revision } = JSON.parse(fs.readFileSync(revisionPath, "utf8")));
}