Closed Shahul9891NL closed 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:
rc
or nightly
versions. (docs)doctor
command to diagnose common issues.Thank you!
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.
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.
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
just tested it on a clean docker container and it works:
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.
The instructions are here. They're slightly different for sf
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
export ROOTDIR=force-app/main/default/
Install Salesforce CLI
Output CLI version and plug-in information
New CI Script:
Setup SFDX environment variables
export ROOTDIR=force-app/main/default/
Install Salesforce CLI
Output CLI version and plug-in information
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
openssl aes-256-cbc -d -md md5 -in JWTFiles/server.key.enc -out JWTFiles/server.key -k $SERVER_KEY_PASSWORD
Setup SFDX environment variables
export ROOTDIR=force-app/main/default/
Install Salesforce CLI
Output CLI version and plug-in information
stages:
deploy: stage: deploy
script:
Setting consumer key and username for the script to run
echo "Starting Deployment..."
if [ "$CI_COMMIT_BRANCH" == "INTG" ]; then USERNAME="$SF_USERNAME_INTG"; CONSUMERKEY="$SF_CONSUMER_KEY_INTG"; elif [ "$CI_COMMIT_BRANCH" == "SIT" ]; then USERNAME="$SF_USERNAME_SIT"; CONSUMERKEY="$SF_CONSUMER_KEY_SIT"; elif [ "$CI_COMMIT_BRANCH" == "UAT" ]; then USERNAME="$SF_USERNAME_UAT"; CONSUMERKEY="$SF_CONSUMER_KEY_UAT"; elif [ "$CI_COMMIT_BRANCH" == "master" ]; then USERNAME="$SF_USERNAME_PROD"; CONSUMERKEY="$SF_CONSUMER_KEY_PROD";
else echo "None of the condition met"; fi
if [ "$CI_COMMIT_BRANCH" == "master" ]; then CHECKONLY="-c"; SFDC_LOGIN_URL="$SFDC_PRODUCTION_URL"; else SFDC_LOGIN_URL="$SFDC_SANDBOX_URL"; fi
Authenticate to the target org using the server key
sfdx auth:jwt:grant --clientid ${CONSUMERKEY} --jwtkeyfile JWTFiles/server.key --username ${USERNAME} --instanceurl ${SFDC_LOGIN_URL}
if [ "$CI_COMMIT_BRANCH" == "master" ]; then MODULE="-l RunLocalTests"; else MODULE=""; fi
Deploying metadata to the target org
sfdx force:source:deploy --targetusername ${USERNAME} -p $ROOTDIR ${MODULE} ${CHECKONLY} rules: