acquia / cli

Acquia CLI
GNU General Public License v2.0
42 stars 47 forks source link

CLI-1378: How to push artifact to multiple git urls. #1782

Closed rahulrasgon closed 4 days ago

rahulrasgon commented 3 weeks ago

Describe the issue We are using the acquia pipeline to push the artifact to acquia cloud to multiple git urls. We are having issue while pushing the code to both the girl URLS. As i can see, issue might be with https://github.com/acquia/cli/blob/main/src/Command/Push/PushArtifactCommand.php#L94 when no-clone argument is provided. Both the git urls provided in destination-git-urls argument becomes empty.

empty destinationGitUrls varaiable is passed to. https://github.com/acquia/cli/blob/69a2053daac836600b2bb3cdfe6f33efd34decbc/src/Command/Push/PushArtifactCommand.php#L139

joshirohit100 commented 2 weeks ago

To me looks like because of https://github.com/acquia/cli/pull/1584/files#diff-7e16059472a0a30afb6cad8f68ba90a7221659f3fb069dc62327720bce9a6778L78 since 2.17.0 release

If you could share the exact command that you are trying as to me --no-clone looks like required option (required in sense command to work - not pass no-clone)

Refer this https://github.com/acquia/cli/blob/main/src/Command/Push/PushArtifactCommand.php#L76 If no-clone option is passed, this means no commit and push will be done.

rahulrasgon commented 2 weeks ago

To me looks like because of https://github.com/acquia/cli/pull/1584/files#diff-7e16059472a0a30afb6cad8f68ba90a7221659f3fb069dc62327720bce9a6778L78 since 2.17.0 release

If you could share the exact command that you are trying as to me --no-clone looks like required option (required in sense command to work - not pass no-clone)

Refer this https://github.com/acquia/cli/blob/main/src/Command/Push/PushArtifactCommand.php#L76 If no-clone option is passed, this means no commit and push will be done.

We are using the below commend acli push:artifact --destination-git-urls=GIT_URL1,GIT_URL2 --destination-git-branch="${PIPELINE_VCS_PATH}-build" --no-interaction --verbose --no-clone --no-commit

Code is not pushing to any of the Git urls provided

joshirohit100 commented 2 weeks ago

Try with removing the option --no-clone --no-commit as seems these options are only for dry run kind

rahulrasgon commented 2 weeks ago

Below command works

acli push:artifact --destination-git-urls=GIT1 --destination-git-urls=GIT2 --destination-git-branch="develop-build" --no-interaction --verbose

We need to pass GIT URLs as a array.

rahulrasgon commented 2 weeks ago

1784

danepowell commented 1 week ago

Keeping this open. While the linked PR should work, I think you can also separate the URLs in a single argument by commas, but I haven't tried that.

We should figure out which approach is canonical by Symfony standards, and bake that into the help text for the specific argument (e.g., The URL(s) of your git repository to which the artifact branch will be pushed (comma-separated))

joshirohit100 commented 1 week ago

As per symfony docs - https://symfony.com/doc/current/console/input.html -

InputOption::VALUE_IS_ARRAY
This option accepts multiple values (e.g. --dir=/foo --dir=/bar);