Skip to content

Commit

Permalink
fix(node): use shorthand run-commands for docker build (#15231)
Browse files Browse the repository at this point in the history
  • Loading branch information
nartc committed Feb 24, 2023
1 parent 88199e5 commit 65b1cdd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
10 changes: 2 additions & 8 deletions packages/node/src/generators/setup-docker/setup-docker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ describe('setupDockerGenerator', () => {
expect.objectContaining({
'docker-build': {
dependsOn: ['build'],
executor: 'nx:run-commands',
options: {
command: 'docker build -f api/Dockerfile . -t api',
},
command: 'docker build -f api/Dockerfile . -t api',
},
})
);
Expand All @@ -48,10 +45,7 @@ describe('setupDockerGenerator', () => {
expect.objectContaining({
'docker-build': {
dependsOn: ['build'],
executor: 'nx:run-commands',
options: {
command: 'docker build -f Dockerfile . -t api',
},
command: 'docker build -f Dockerfile . -t api',
},
})
);
Expand Down
11 changes: 4 additions & 7 deletions packages/node/src/generators/setup-docker/setup-docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,10 @@ export function updateProjectConfig(tree: Tree, options: SetUpDockerOptions) {

projectConfig.targets[`${options.targetName}`] = {
dependsOn: [`${options.buildTarget}`],
executor: 'nx:run-commands',
options: {
command: `docker build -f ${joinPathFragments(
projectConfig.root,
'Dockerfile'
)} . -t ${options.project}`,
},
command: `docker build -f ${joinPathFragments(
projectConfig.root,
'Dockerfile'
)} . -t ${options.project}`,
};

updateProjectConfiguration(tree, options.project, projectConfig);
Expand Down

0 comments on commit 65b1cdd

Please sign in to comment.