forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
491 stars 79 forks source link

sf: command not found on GITLAB CLI Installation through Yaml file #2464

Closed Shahul9891NL closed 1 year ago

Shahul9891NL commented 1 year ago

Note Before you submit your issue, make sure that:

  • You're using the latest version of Salesforce CLI.
  • You've searched both open and closed issues for related posts.
  • You've used the doctor command to diagnose common issues.
  • You understand that GitHub Issues don't adhere to any agreement or SLA.
    • If you require immediate assistance, use official channels such as Salesforce Customer Support.

Summary

In the CI Script on GITLAB , Old SFDX CLI Tar file URL stopped working

Steps To Reproduce

OLD CI Script:

Setup SFDX environment variables

New CI Script:

Setup SFDX environment variables

Expected result

It should return the installed version

Actual result

but we are receiving sf command not found, we are not able to proceed to next step as below. System is not recognizing the installation

JWT Auth and force deploy

Adding our complete Script file

# default: tags:

before_script:

Decrypt server key

stages:

deploy: stage: deploy
script:

Setting consumer key and username for the script to run

github-actions[bot] commented 1 year ago

Hello @Shahul9891NL :wave: It looks like you didn't include the full Salesforce CLI version information in your issue. Please provide the output of version --verbose --json for the CLI you're using (sf or sfdx).

A few more things to check:

Thank you!

github-actions[bot] commented 1 year ago

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

Shahul9891NL commented 1 year ago

https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable/sf-linux-x64.tar.xz

cristiand391 commented 1 year ago

Hey @Shahul9891NL, we deleted that old tarball a few days ago, see: https://github.com/forcedotcom/cli/issues/2460#issuecomment-1714309082

Last time we checked it was pointing to sfdx v7.82.0, which was published almost 3 years ago.

Shahul9891NL commented 1 year ago

Thanks cristian for checking. We are using the latest version, but that is also failing https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable/sf-linux-x64.tar.xz

cristiand391 commented 1 year ago

just tested it on a clean docker container and it works:

Screenshot 2023-09-13 at 10 47 03

After reading how you are installing it:

mkdir sfdx
wget -qO- $CLIURL | tar xJ -C sfdx --strip-components 1
export PATH=./sfdx/$(pwd):$PATH

I think it's because you are adding sfdx to your $PATH when that should be sfdx/bin.

If that was working before it may be that the old tarballs was putting the CLI bin in the top-level folder.

mshanemc commented 1 year ago

The instructions are here. They're slightly different for sf

https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm#sfdx_setup_install_cli_linux