Skip to content

Commit

Permalink
Remove the pathProject as mandatory (#6905)
Browse files Browse the repository at this point in the history
  • Loading branch information
mauriziovitale authored and Thomas Hunter committed Apr 9, 2021
1 parent e357ceb commit 8c79ab5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/cli/scripts/docker-publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import { exec } from './exec';
import * as program from 'commander';
import { logger } from './logger';
import { resolve } from 'path';

export interface PublishArgs {
tag?: string;
Expand Down Expand Up @@ -71,15 +72,15 @@ function main(args) {
program
.version('0.1.0')
.description('Move in the folder where you have your Dockerfile and run the command:\n\n' +
'adf-cli docker-publish --dockerRepo "${docker_repository}" --dockerTags "${TAGS}" --pathProject "$(pwd)"')
'adf-cli docker-publish --dockerRepo "${docker_repository}" --dockerTags "${TAGS}"')
.option('--loginRepo [type]', 'URL registry')
.option('--loginPassword [type]', ' password')
.option('--loginUsername [type]', ' username')
.option('--loginCheck [type]', 'perform login')
.option('--pathProject [type]', 'the path build context')
.requiredOption('--dockerRepo [type]', 'docker repo')
.requiredOption('--dockerTags [type]', ' tags')
.requiredOption('--buildArgs [type]', ' buildArgs')
.requiredOption('--pathProject [type]', 'path project')
.parse(process.argv);

if (process.argv.includes('-h') || process.argv.includes('--help')) {
Expand All @@ -91,6 +92,10 @@ function main(args) {
loginPerform(args);
}

if(args.pathProject === undefined) {
args.pathProject = resolve('./')
}

let mainTag;
if (args.dockerTags !== '') {
args.dockerTags.split(',').forEach( (tag, index) => {
Expand Down

0 comments on commit 8c79ab5

Please sign in to comment.