@nx/docker 0.0.0-pr-31634-ece4eca → 0.0.0-pr-31634-e87d792
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.
- package/generators.json +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -0
- package/package.json +13 -6
- package/project.json +52 -0
- package/src/executors/release-publish/release-publish.impl.d.ts +1 -0
- package/src/executors/release-publish/release-publish.impl.d.ts.map +1 -0
- package/src/executors/release-publish/release-publish.impl.js +7 -7
- package/src/executors/release-publish/schema.d.ts +2 -0
- package/src/executors/release-publish/schema.json +5 -0
- package/src/generators/init/init.d.ts +1 -1
- package/src/generators/init/init.d.ts.map +1 -0
- package/src/generators/init/init.js +5 -14
- package/src/plugins/plugin.d.ts +1 -0
- package/src/plugins/plugin.d.ts.map +1 -0
- package/src/plugins/plugin.js +17 -7
- package/src/release/version-pattern-utils.d.ts +1 -0
- package/src/release/version-pattern-utils.d.ts.map +1 -0
- package/src/release/version-utils.d.ts +4 -2
- package/src/release/version-utils.d.ts.map +1 -0
- package/src/release/version-utils.js +12 -5
- package/src/utils/versions.d.ts +1 -0
- package/src/utils/versions.d.ts.map +1 -0
- package/src/utils/versions.js +1 -1
package/generators.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"version": "0.1",
|
|
4
4
|
"generators": {
|
|
5
5
|
"init": {
|
|
6
|
-
"factory": "./src/generators/init/init
|
|
6
|
+
"factory": "./src/generators/init/init",
|
|
7
7
|
"schema": "./src/generators/init/schema.json",
|
|
8
8
|
"description": "Initialize the `@nx/docker` plugin. **Experimental**: Docker support is experimental. Breaking changes may occur and not adhere to semver versioning.",
|
|
9
9
|
"aliases": ["ng-add"],
|
package/index.d.ts
CHANGED
package/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/docker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/docker",
|
|
3
3
|
"description": "The Nx Plugin for Docker to aid in containerizing projects.",
|
|
4
|
-
"version": "0.0.0-pr-31634-
|
|
4
|
+
"version": "0.0.0-pr-31634-e87d792",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -32,16 +32,23 @@
|
|
|
32
32
|
"types": "./src/release/version-utils.d.ts",
|
|
33
33
|
"default": "./src/release/version-utils.js"
|
|
34
34
|
},
|
|
35
|
-
"./package.json":
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
"./package.json": "./package.json",
|
|
36
|
+
"./generators.json": "./generators.json",
|
|
37
|
+
"./executors.json": "./executors.json",
|
|
38
|
+
"./migrations.json": "./migrations.json"
|
|
39
|
+
},
|
|
40
|
+
"nx-migrations": {
|
|
41
|
+
"migrations": "./migrations.json"
|
|
38
42
|
},
|
|
39
43
|
"executors": "./executors.json",
|
|
40
44
|
"generators": "./generators.json",
|
|
41
45
|
"dependencies": {
|
|
42
|
-
"@nx/devkit": "0.0.0-pr-31634-
|
|
46
|
+
"@nx/devkit": "0.0.0-pr-31634-e87d792",
|
|
43
47
|
"enquirer": "~2.3.6",
|
|
44
48
|
"tslib": "^2.3.0"
|
|
45
49
|
},
|
|
46
|
-
"
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"nx": "0.0.0-pr-31634-e87d792"
|
|
52
|
+
},
|
|
53
|
+
"types": "./src/index.d.ts"
|
|
47
54
|
}
|
package/project.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "docker",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"sourceRoot": "packages/docker",
|
|
5
|
+
"projectType": "library",
|
|
6
|
+
"targets": {
|
|
7
|
+
"build": {
|
|
8
|
+
"command": "node ./scripts/copy-readme.js docker",
|
|
9
|
+
"outputs": ["{workspaceRoot}/build/packages/docker/README.md"]
|
|
10
|
+
},
|
|
11
|
+
"legacy-post-build": {
|
|
12
|
+
"executor": "@nx/workspace-plugin:legacy-post-build",
|
|
13
|
+
"options": {
|
|
14
|
+
"tsConfig": "./tsconfig.lib.json",
|
|
15
|
+
"assets": [
|
|
16
|
+
{
|
|
17
|
+
"input": "packages/docker",
|
|
18
|
+
"glob": "**/files/**",
|
|
19
|
+
"output": "/"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"input": "packages/docker",
|
|
23
|
+
"glob": "**files/**/.gitkeep",
|
|
24
|
+
"output": "/"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"input": "packages/docker",
|
|
28
|
+
"glob": "**/*.json",
|
|
29
|
+
"ignore": ["**/tsconfig*.json", "project.json", ".eslintrc.json"],
|
|
30
|
+
"output": "/"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"input": "packages/docker",
|
|
34
|
+
"glob": "**/*.js",
|
|
35
|
+
"ignore": ["**/jest.config.js"],
|
|
36
|
+
"output": "/"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"input": "packages/docker",
|
|
40
|
+
"glob": "**/*.d.ts",
|
|
41
|
+
"output": "/"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"input": "",
|
|
45
|
+
"glob": "LICENSE",
|
|
46
|
+
"output": "/"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-publish.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/docker/src/executors/release-publish/release-publish.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAIhB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,0BAA0B,EAE3B,MAAM,UAAU,CAAC;AAIlB,wBAA8B,oBAAoB,CAChD,MAAM,EAAE,0BAA0B,EAClC,OAAO,EAAE,eAAe;;GAiBzB"}
|
|
@@ -3,14 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = dockerReleasePublish;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const child_process_1 = require("child_process");
|
|
6
|
-
const path_1 = require("path");
|
|
7
6
|
const fs_1 = require("fs");
|
|
7
|
+
const version_utils_1 = require("../../release/version-utils");
|
|
8
8
|
async function dockerReleasePublish(schema, context) {
|
|
9
|
-
devkit_1.logger.warn(`Docker support is experimental. Breaking changes may occur and not adhere to semver versioning.`);
|
|
10
9
|
const projectConfig = context.projectGraph.nodes[context.projectName];
|
|
11
10
|
const options = normalizeOptions(projectConfig, schema);
|
|
12
11
|
if (!options.dryRun) {
|
|
13
|
-
const digest = dockerPush(options.imageReference);
|
|
12
|
+
const digest = dockerPush(options.imageReference, options.quiet);
|
|
14
13
|
devkit_1.logger.log(`Successfully pushed ${options.imageReference}. Digest: ${digest}`);
|
|
15
14
|
}
|
|
16
15
|
else {
|
|
@@ -22,6 +21,7 @@ async function dockerReleasePublish(schema, context) {
|
|
|
22
21
|
}
|
|
23
22
|
function normalizeOptions(projectConfig, schema) {
|
|
24
23
|
return {
|
|
24
|
+
quiet: schema.quiet ?? false,
|
|
25
25
|
imageReference: findImageReference(projectConfig, schema),
|
|
26
26
|
dryRun: process.env.NX_DRY_RUN === 'true' || schema.dryRun || false,
|
|
27
27
|
};
|
|
@@ -36,9 +36,9 @@ function findImageReference(projectConfig, schema) {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
function readVersionFromFile(projectRoot) {
|
|
39
|
-
const versionFilePath = (0,
|
|
39
|
+
const versionFilePath = (0, version_utils_1.getDockerVersionPath)(devkit_1.workspaceRoot, projectRoot);
|
|
40
40
|
if (!(0, fs_1.existsSync)(versionFilePath)) {
|
|
41
|
-
throw new Error(
|
|
41
|
+
throw new Error(`Could not find ${versionFilePath} file. Did you run 'nx release version'?`);
|
|
42
42
|
}
|
|
43
43
|
const version = (0, fs_1.readFileSync)(versionFilePath, { encoding: 'utf8' });
|
|
44
44
|
return version.trim();
|
|
@@ -52,9 +52,9 @@ function checkDockerImageExistsLocally(imageRef) {
|
|
|
52
52
|
return false;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
function dockerPush(imageReference) {
|
|
55
|
+
function dockerPush(imageReference, quiet) {
|
|
56
56
|
try {
|
|
57
|
-
const result = (0, child_process_1.execSync)(`docker push ${imageReference} --quiet`, {
|
|
57
|
+
const result = (0, child_process_1.execSync)(`docker push ${imageReference}${quiet ? ' --quiet' : ''}`, {
|
|
58
58
|
encoding: 'utf8',
|
|
59
59
|
});
|
|
60
60
|
return result.trim();
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
"dryRun": {
|
|
9
9
|
"type": "boolean",
|
|
10
10
|
"description": "Whether to run the command without actually publishing the image to the registry."
|
|
11
|
+
},
|
|
12
|
+
"quiet": {
|
|
13
|
+
"type": "boolean",
|
|
14
|
+
"description": "Suppress verbose output",
|
|
15
|
+
"default": false
|
|
11
16
|
}
|
|
12
17
|
},
|
|
13
18
|
"required": []
|
|
@@ -2,5 +2,5 @@ import { type Tree, type GeneratorCallback } from '@nx/devkit';
|
|
|
2
2
|
import { InitGeneratorSchema } from './schema';
|
|
3
3
|
export declare function updateDependencies(tree: Tree, schema: InitGeneratorSchema): GeneratorCallback;
|
|
4
4
|
export declare function initGenerator(tree: Tree, schema: InitGeneratorSchema): Promise<GeneratorCallback>;
|
|
5
|
-
export declare function initGeneratorInternal(tree: Tree, schema: InitGeneratorSchema): Promise<GeneratorCallback>;
|
|
6
5
|
export default initGenerator;
|
|
6
|
+
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/docker/src/generators/init/init.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,EACT,KAAK,iBAAiB,EAOvB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAI/C,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,mBAAmB,qBAUzE;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,mBAAmB,8BA4B1E;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateDependencies = updateDependencies;
|
|
4
4
|
exports.initGenerator = initGenerator;
|
|
5
|
-
exports.initGeneratorInternal = initGeneratorInternal;
|
|
6
5
|
const devkit_1 = require("@nx/devkit");
|
|
7
6
|
const add_plugin_1 = require("@nx/devkit/src/utils/add-plugin");
|
|
8
7
|
const plugin_1 = require("../../plugins/plugin");
|
|
@@ -12,21 +11,13 @@ function updateDependencies(tree, schema) {
|
|
|
12
11
|
'@nx/docker': versions_1.nxVersion,
|
|
13
12
|
}, undefined, schema.keepExistingVersions);
|
|
14
13
|
}
|
|
15
|
-
function initGenerator(tree, schema) {
|
|
16
|
-
return initGeneratorInternal(tree, { addPlugin: false, ...schema });
|
|
17
|
-
}
|
|
18
|
-
async function initGeneratorInternal(tree, schema) {
|
|
14
|
+
async function initGenerator(tree, schema) {
|
|
19
15
|
devkit_1.logger.warn(`Docker support is experimental. Breaking changes may occur and not adhere to semver versioning.`);
|
|
20
16
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
await (0, add_plugin_1.addPlugin)(tree, await (0, devkit_1.createProjectGraphAsync)(), '@nx/docker', plugin_1.createNodesV2, {
|
|
26
|
-
buildTarget: ['docker:build', 'docker-build', 'build-docker'],
|
|
27
|
-
runTarget: ['docker:run', 'docker-run', 'run-docker'],
|
|
28
|
-
}, schema.updatePackageScripts);
|
|
29
|
-
}
|
|
17
|
+
await (0, add_plugin_1.addPlugin)(tree, await (0, devkit_1.createProjectGraphAsync)(), '@nx/docker', plugin_1.createNodesV2, {
|
|
18
|
+
buildTarget: ['docker:build', 'docker-build', 'build-docker'],
|
|
19
|
+
runTarget: ['docker:run', 'docker-run', 'run-docker'],
|
|
20
|
+
}, schema.updatePackageScripts);
|
|
30
21
|
const tasks = [];
|
|
31
22
|
if (!schema.skipPackageJson) {
|
|
32
23
|
tasks.push(updateDependencies(tree, schema));
|
package/src/plugins/plugin.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/docker/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAOnB,MAAM,YAAY,CAAC;AAQpB,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAsBD,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,mBAAmB,CAkC5D,CAAC"}
|
package/src/plugins/plugin.js
CHANGED
|
@@ -14,25 +14,26 @@ function readTargetsCache(cachePath) {
|
|
|
14
14
|
function writeTargetsCache(cachePath, results) {
|
|
15
15
|
(0, devkit_1.writeJsonFile)(cachePath, results ?? {});
|
|
16
16
|
}
|
|
17
|
-
const dockerfileGlob = '
|
|
17
|
+
const dockerfileGlob = 'Dockerfile,**/Dockerfile';
|
|
18
18
|
exports.createNodesV2 = [
|
|
19
19
|
dockerfileGlob,
|
|
20
20
|
async (configFilePaths, options, context) => {
|
|
21
21
|
const optionsHash = (0, file_hasher_1.hashObject)(options);
|
|
22
22
|
const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `docker-${optionsHash}.hash`);
|
|
23
23
|
const targetsCache = readTargetsCache(cachePath);
|
|
24
|
+
const projectRoots = configFilePaths.map((c) => (0, path_1.dirname)(c));
|
|
25
|
+
const normalizedOptions = normalizePluginOptions(options);
|
|
26
|
+
const hashes = await (0, calculate_hash_for_create_nodes_1.calculateHashesForCreateNodes)(projectRoots, normalizedOptions, context);
|
|
24
27
|
try {
|
|
25
|
-
return await (0, devkit_1.createNodesFromFiles)((configFile,
|
|
28
|
+
return await (0, devkit_1.createNodesFromFiles)((configFile, _, context, idx) => createNodesInternal(configFile, hashes[idx] + configFile, normalizedOptions, context, targetsCache), configFilePaths, options, context);
|
|
26
29
|
}
|
|
27
30
|
finally {
|
|
28
31
|
writeTargetsCache(cachePath, targetsCache);
|
|
29
32
|
}
|
|
30
33
|
},
|
|
31
34
|
];
|
|
32
|
-
async function createNodesInternal(configFilePath,
|
|
35
|
+
async function createNodesInternal(configFilePath, hash, normalizedOptions, context, targetsCache) {
|
|
33
36
|
const projectRoot = (0, path_1.dirname)(configFilePath);
|
|
34
|
-
const normalizedOptions = normalizePluginOptions(options);
|
|
35
|
-
const hash = await (0, calculate_hash_for_create_nodes_1.calculateHashForCreateNodes)(projectRoot, normalizedOptions, context);
|
|
36
37
|
targetsCache[hash] ??= await createDockerTargets(projectRoot, normalizedOptions, context);
|
|
37
38
|
const { targets, metadata } = targetsCache[hash];
|
|
38
39
|
return {
|
|
@@ -65,7 +66,12 @@ async function createDockerTargets(projectRoot, options, context) {
|
|
|
65
66
|
description: `Run Docker build`,
|
|
66
67
|
help: {
|
|
67
68
|
command: `docker build --help`,
|
|
68
|
-
example: {
|
|
69
|
+
example: {
|
|
70
|
+
options: {
|
|
71
|
+
'cache-from': 'type=s3,region=eu-west-1,bucket=mybucket .',
|
|
72
|
+
'cache-to': 'type=s3,region=eu-west-1,bucket=mybucket .',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
69
75
|
},
|
|
70
76
|
},
|
|
71
77
|
};
|
|
@@ -85,7 +91,11 @@ async function createDockerTargets(projectRoot, options, context) {
|
|
|
85
91
|
description: `Run Docker run`,
|
|
86
92
|
help: {
|
|
87
93
|
command: `docker run --help`,
|
|
88
|
-
example: {
|
|
94
|
+
example: {
|
|
95
|
+
options: {
|
|
96
|
+
args: ['-p', '3000:3000'],
|
|
97
|
+
},
|
|
98
|
+
},
|
|
89
99
|
},
|
|
90
100
|
},
|
|
91
101
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-pattern-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/docker/src/release/version-pattern-utils.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,IAAI,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CACxB;AAsBD,wBAAgB,yBAAyB,CACvC,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,UA4B7B"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { ProjectGraphProjectNode } from '@nx/devkit';
|
|
1
|
+
import type { ProjectGraphProjectNode } from '@nx/devkit';
|
|
2
2
|
import type { FinalConfigForProject } from 'nx/src/command-line/release/version/release-group-processor';
|
|
3
|
-
export declare
|
|
3
|
+
export declare const getDockerVersionPath: (workspaceRoot: string, projectRoot: string) => string;
|
|
4
|
+
export declare function handleDockerVersion(workspaceRoot: string, projectGraphNode: ProjectGraphProjectNode, finalConfigForProject: FinalConfigForProject, dockerVersionScheme?: string): Promise<{
|
|
4
5
|
newVersion: string;
|
|
5
6
|
logs: string[];
|
|
6
7
|
}>;
|
|
8
|
+
//# sourceMappingURL=version-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/docker/src/release/version-utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6DAA6D,CAAC;AAQzG,eAAO,MAAM,oBAAoB,GAC/B,eAAe,MAAM,EACrB,aAAa,MAAM,WAGpB,CAAC;AAEF,wBAAsB,mBAAmB,CACvC,aAAa,EAAE,MAAM,EACrB,gBAAgB,EAAE,uBAAuB,EACzC,qBAAqB,EAAE,qBAAqB,EAC5C,mBAAmB,CAAC,EAAE,MAAM;;;GA4B7B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDockerVersionPath = void 0;
|
|
3
4
|
exports.handleDockerVersion = handleDockerVersion;
|
|
4
5
|
const child_process_1 = require("child_process");
|
|
5
6
|
const fs_1 = require("fs");
|
|
@@ -10,12 +11,18 @@ const DEFAULT_VERSION_SCHEMES = {
|
|
|
10
11
|
production: '{currentDate|YYMM.DD}.{shortCommitSha}',
|
|
11
12
|
hotfix: '{currentDate|YYMM.DD}.{shortCommitSha}-hotfix',
|
|
12
13
|
};
|
|
13
|
-
|
|
14
|
+
const getDockerVersionPath = (workspaceRoot, projectRoot) => {
|
|
15
|
+
return (0, path_1.join)(workspaceRoot, 'tmp', projectRoot, '.docker-version');
|
|
16
|
+
};
|
|
17
|
+
exports.getDockerVersionPath = getDockerVersionPath;
|
|
18
|
+
async function handleDockerVersion(workspaceRoot, projectGraphNode, finalConfigForProject, dockerVersionScheme) {
|
|
14
19
|
const availableVersionSchemes = finalConfigForProject.dockerOptions.versionSchemes ??
|
|
15
20
|
DEFAULT_VERSION_SCHEMES;
|
|
16
|
-
const versionScheme =
|
|
21
|
+
const versionScheme = dockerVersionScheme && dockerVersionScheme in availableVersionSchemes
|
|
22
|
+
? dockerVersionScheme
|
|
23
|
+
: await promptForNewVersion(availableVersionSchemes, projectGraphNode.name);
|
|
17
24
|
const newVersion = calculateNewVersion(projectGraphNode.name, versionScheme, availableVersionSchemes);
|
|
18
|
-
const logs = updateProjectVersion(newVersion, projectGraphNode.data.root, finalConfigForProject.dockerOptions.repositoryName, finalConfigForProject.dockerOptions.registryUrl);
|
|
25
|
+
const logs = updateProjectVersion(newVersion, workspaceRoot, projectGraphNode.data.root, finalConfigForProject.dockerOptions.repositoryName, finalConfigForProject.dockerOptions.registryUrl);
|
|
19
26
|
return {
|
|
20
27
|
newVersion,
|
|
21
28
|
logs,
|
|
@@ -43,7 +50,7 @@ function calculateNewVersion(projectName, versionScheme, versionSchemes) {
|
|
|
43
50
|
projectName,
|
|
44
51
|
});
|
|
45
52
|
}
|
|
46
|
-
function updateProjectVersion(newVersion, projectRoot, repositoryName, registry) {
|
|
53
|
+
function updateProjectVersion(newVersion, workspaceRoot, projectRoot, repositoryName, registry) {
|
|
47
54
|
const isDryRun = process.env.NX_DRY_RUN && process.env.NX_DRY_RUN !== 'false';
|
|
48
55
|
const imageRef = getDefaultImageReference(projectRoot);
|
|
49
56
|
const newImageRef = getImageReference(projectRoot, repositoryName, registry);
|
|
@@ -56,7 +63,7 @@ function updateProjectVersion(newVersion, projectRoot, repositoryName, registry)
|
|
|
56
63
|
logs.push(`No changes were applied as --dry-run is enabled.`);
|
|
57
64
|
}
|
|
58
65
|
else {
|
|
59
|
-
(0, fs_1.writeFileSync)((0,
|
|
66
|
+
(0, fs_1.writeFileSync)((0, exports.getDockerVersionPath)(workspaceRoot, projectRoot), fullImageRef);
|
|
60
67
|
}
|
|
61
68
|
return logs;
|
|
62
69
|
}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../../../packages/docker/src/utils/versions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,KAAwC,CAAC"}
|
package/src/utils/versions.js
CHANGED