@platforma-open/milaboratories.software-mixcr 4.7.0-112-develop

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"name":"@platforma-open/milaboratories.software-mixcr:main","binary":{"type":"java","registry":"milaboratories","package":"milaboratories/mixcr/4.7.0-112-develop.tgz","cmd":["java","-jar","{pkg}/mixcr.jar"],"envVars":[],"runEnv":{"name":"@platforma-open/milaboratories.runenv-java-corretto:21.0.2.13.1","type":"java","registry":"platforma-open","package":"platforma-open/milaboratories.runenv-java-corretto/21.0.2.13.1/21.0.2.13.1-{os}-{arch}.tgz","binDir":"bin"}}}
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@platforma-open/milaboratories.software-mixcr",
3
+ "version": "4.7.0-112-develop",
4
+ "description": "MiXCR software dependency for Platforma Backend",
5
+ "scripts": {
6
+ "build": "true",
7
+ "pkg:build": "pl-pkg build packages",
8
+ "pkg:sign": "pl-pkg sign packages --sign-command='[\"gcloud-kms-sign\", \"{pkg}\", \"{pkg}.sig\"]'",
9
+ "pkg:publish": "pl-pkg publish packages",
10
+ "pkg:release": "npm run pkg:build && npm run pkg:sign && npm run pkg:publish",
11
+ "descriptor:build": "pl-pkg build descriptors",
12
+ "descriptor:publish": "pl-pkg publish descriptors",
13
+ "descriptor:release": "npm run descriptor:build && npm run descriptor:publish",
14
+ "postinstall": "node ./scripts/unpack-ci.js",
15
+ "prepublishOnly": "npm run pkg:release && npm run descriptor:build"
16
+ },
17
+ "block-software": {
18
+ "entrypoints": {
19
+ "main": {
20
+ "binary": {
21
+ "artifact": {
22
+ "registry": "milaboratories",
23
+ "name": "milaboratories/mixcr",
24
+ "type": "java",
25
+ "environment": "@platforma-open/milaboratories.runenv-java-corretto:21.0.2.13.1",
26
+ "root": "./dld/mixcr/"
27
+ },
28
+ "cmd": [
29
+ "java",
30
+ "-jar",
31
+ "{pkg}/mixcr.jar"
32
+ ]
33
+ }
34
+ }
35
+ }
36
+ },
37
+ "files": [
38
+ "dist/",
39
+ "scripts/unpack-ci.js"
40
+ ],
41
+ "license": "UNLICENSED",
42
+ "devDependencies": {
43
+ "@platforma-sdk/package-builder": "^2.9.2",
44
+ "@platforma-open/milaboratories.runenv-java-corretto": "^1.0.2",
45
+ "unzipper": "^0.12.3"
46
+ }
47
+ }
@@ -0,0 +1,70 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require("fs");
4
+ const path = require("path");
5
+
6
+ const scriptDir = __dirname;
7
+ const packageRoot = path.resolve(scriptDir, "../");
8
+ const dstRoot = path.join(packageRoot, "dld");
9
+ const dstDataDir = path.join(dstRoot, "mixcr");
10
+
11
+ function log(message) {
12
+ console.log(message);
13
+ }
14
+
15
+ if (!process.env.CI) {
16
+ process.exit(0);
17
+ }
18
+
19
+ const ARCHIVE_PATH = process.env.ARCHIVE_PATH;
20
+ if (!ARCHIVE_PATH) {
21
+ log(
22
+ "To unpack existing archive after installation, provide 'ARCHIVE_PATH'" +
23
+ "environment variable with path to the mixcr archive before running 'npm ci' or 'npm install'"
24
+ );
25
+ process.exit(0)
26
+ }
27
+
28
+ function isDir(target) {
29
+ const stats = fs.statSync(target);
30
+ return stats.isDirectory();
31
+ }
32
+
33
+ function findZipArchive(archivePath) {
34
+ if (!isDir(archivePath)) {
35
+ return archivePath
36
+ }
37
+
38
+ const files = fs.readdirSync(archivePath, { recursive: false })
39
+ const zipFiles = files.filter((name) => name.endsWith(".zip"))
40
+
41
+ if (zipFiles.length === 0) {
42
+ log(`No zip archive found in '${archivePath}'`);
43
+ return "";
44
+ } else if (zipFiles.length > 1) {
45
+ log("More than one zip archive found. Please specify which one to use.");
46
+ return "";
47
+ } else {
48
+ return path.join(archivePath, zipFiles[0]);
49
+ }
50
+ }
51
+
52
+ const archivePath = findZipArchive(ARCHIVE_PATH);
53
+ if (!archivePath) {
54
+ process.exit(1);
55
+ }
56
+
57
+ log(`Zip archive found at '${archivePath}'`);
58
+
59
+ if (fs.existsSync(dstDataDir)) {
60
+ log(`Removing old data dir: ${dstDataDir}`);
61
+ fs.rmSync(dstDataDir, { recursive: true, force: true });
62
+ }
63
+ log(`Creating clean data dir: ${dstDataDir}`);
64
+ fs.mkdirSync(dstDataDir, { recursive: true });
65
+
66
+ const unzipper = require("unzipper");
67
+
68
+ fs.createReadStream(archivePath)
69
+ .pipe(unzipper.Extract({ path: dstDataDir }))
70
+ .on("close", () => log(`Extraction complete to '${dstDataDir}'`));