Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced SFDX commands with latest sf #541

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
- run: yarn
- run: yarn prepack
- run: npm i @salesforce/cli -g
- run: echo y|sfdx plugins:install sfdx-hardis
- run: sfdx hardis:doc:plugin:generate
- run: echo y|sf plugins install sfdx-hardis
- run: sf hardis:doc:plugin:generate
# Deploy docs with mkdocs-material
- uses: actions/setup-python@v2
with:
Expand Down
8,190 changes: 8,190 additions & 0 deletions README.md

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions defaults/ci/.github/workflows/check-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ jobs:
run: |
npm install --no-cache @salesforce/cli --global
sf plugins install @salesforce/plugin-packaging
echo 'y' | sfdx plugins:install sfdx-hardis
echo 'y' | sfdx plugins:install sfdx-essentials
echo 'y' | sfdx plugins:install sfdx-git-delta
echo 'y' | sf plugins:install sfdx-hardis
echo 'y' | sf plugins:install sfdx-essentials
echo 'y' | sf plugins:install sfdx-git-delta
sf version --verbose --json
# Login & check deploy with test classes & code coverage
- name: Login & Simulate deployment
Expand All @@ -68,5 +68,5 @@ jobs:
FORCE_COLOR: "1"
run: |
echo "Simulate SFDX deployment using Hardis against \"$CONFIG_BRANCH\""
sfdx hardis:auth:login
sfdx hardis:project:deploy:sources:dx --check
sf hardis:auth:login
sf hardis:project:deploy:sources:dx --check
12 changes: 6 additions & 6 deletions defaults/ci/.github/workflows/process-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ jobs:
run: |
npm install @salesforce/cli --global
sf plugins install @salesforce/plugin-packaging
echo 'y' | sfdx plugins:install sfdx-hardis
echo 'y' | sfdx plugins:install sfdx-essentials
# echo 'y' | sfdx plugins:install sfdmu # Disabled while it does not play well with @salesforce/cli
echo 'y' | sfdx plugins:install sfdx-git-delta
echo 'y' | sf plugins:install sfdx-hardis
echo 'y' | sf plugins:install sfdx-essentials
# echo 'y' | sf plugins:install sfdmu # Disabled while it does not play well with @salesforce/cli
echo 'y' | sf plugins:install sfdx-git-delta
sf version --verbose --json
# Set env branch variable (github.ref_name seems to not work)
- name: Set env.BRANCH
Expand Down Expand Up @@ -69,5 +69,5 @@ jobs:
FORCE_COLOR: "1"
run: |
echo "Process SFDX deployment using Hardis against \"$CONFIG_BRANCH\""
sfdx hardis:auth:login
sfdx hardis:project:deploy:sources:dx
sf hardis:auth:login
sf hardis:project:deploy:sources:dx
30 changes: 15 additions & 15 deletions defaults/ci/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ check_deploy_to_target_branch_org:
ORG_ALIAS: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
script:
- '[ -z "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" ] && exit 0;' # Skip this job if it is launched from web UI and we are not in merge request context
- sfdx hardis:auth:login
- sfdx hardis:project:deploy:sources:dx --check
- sf hardis:auth:login
- sf hardis:project:deploy:sources:dx --check

# Create scratch org to check the sources push & the unit tests
create_scratch_org:
Expand All @@ -101,8 +101,8 @@ create_scratch_org:
- $USE_SCRATCH_ORGS == "false"
interruptible: true
script:
- sfdx hardis:auth:login --devhub
- sfdx hardis:scratch:create
- sf hardis:auth:login --devhub
- sf hardis:scratch:create
artifacts:
when: always
expire_in: 60 minutes
Expand All @@ -121,8 +121,8 @@ refresh_scratch_org_pool:
- $SCRATCH_ORG_POOL == "true"
interruptible: true
script:
- sfdx hardis:auth:login --devhub
- sfdx hardis:scratch:pool:refresh
- sf hardis:auth:login --devhub
- sf hardis:scratch:pool:refresh
artifacts:
when: always

Expand All @@ -145,8 +145,8 @@ test_apex:
artifacts: true
script:
- sleep 120 # Orgs just created can be not ready yet, let's wait a while before running tests
- sfdx hardis:auth:login --scratchorg || true
- sfdx hardis:org:test:apex
- sf hardis:auth:login --scratchorg || true
- sf hardis:org:test:apex
artifacts:
when: always
paths:
Expand Down Expand Up @@ -187,9 +187,9 @@ clean:
- job: create_scratch_org
- job: test_apex
script:
- sfdx hardis:auth:login --devhub
- sfdx hardis:auth:login --scratchorg || true
- sfdx force:org:delete --noprompt || true
- sf hardis:auth:login --devhub
- sf hardis:auth:login --scratchorg || true
- sf force:org:delete --noprompt || true

# Simulate deployment to related org
# Is triggered only when scheduled, or via manual launch
Expand All @@ -206,8 +206,8 @@ check_deploy_to_current_branch_org:
- $SCRATCH_ORG_POOL == "true"
interruptible: true
script:
- sfdx hardis:auth:login
- sfdx hardis:project:deploy:sources:dx --check
- sf hardis:auth:login
- sf hardis:project:deploy:sources:dx --check

# Deploy to branch related org when detecting new commit (after a merged merge request)
# Don't forget to define variable DEPLOY_BRANCHES to match your branches in .gitlab-ci-config.yml
Expand All @@ -224,5 +224,5 @@ deploy_to_org:
- $SCRATCH_ORG_POOL == "true"
interruptible: true
script:
- sfdx hardis:auth:login
- sfdx hardis:project:deploy:sources:dx
- sf hardis:auth:login
- sf hardis:project:deploy:sources:dx
10 changes: 5 additions & 5 deletions defaults/ci/azure-pipelines-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ jobs:
- script: |
npm install @salesforce/cli --global
sf plugins install @salesforce/plugin-packaging
echo 'y' | sfdx plugins:install sfdx-hardis
echo 'y' | sfdx plugins:install sfdx-essentials
echo 'y' | sfdx plugins:install sfdx-git-delta
echo 'y' | sf plugins:install sfdx-hardis
echo 'y' | sf plugins:install sfdx-essentials
echo 'y' | sf plugins:install sfdx-git-delta
sf version --verbose --json
displayName: "Install SFDX & plugins"

# Login & check deployment to PR target branch related org (configuration: https://hardisgroupcom.github.io/sfdx-hardis/salesforce-ci-cd-setup-auth/ )
- script: |
sfdx hardis:auth:login
sfdx hardis:project:deploy:sources:dx --check
sf hardis:auth:login
sf hardis:project:deploy:sources:dx --check
env:
SFDX_CLIENT_ID_INTEGRATION: $(SFDX_CLIENT_ID_INTEGRATION)
SFDX_CLIENT_KEY_INTEGRATION: $(SFDX_CLIENT_KEY_INTEGRATION)
Expand Down
12 changes: 6 additions & 6 deletions defaults/ci/azure-pipelines-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ jobs:
- script: |
npm install @salesforce/cli --global
sf plugins install @salesforce/plugin-packaging
echo 'y' | sfdx plugins:install sfdx-hardis
echo 'y' | sfdx plugins:install sfdx-essentials
echo 'y' | sfdx plugins:install sfdmu
echo 'y' | sfdx plugins:install sfdx-git-delta
echo 'y' | sf plugins:install sfdx-hardis
echo 'y' | sf plugins:install sfdx-essentials
echo 'y' | sf plugins:install sfdmu
echo 'y' | sf plugins:install sfdx-git-delta
sf version --verbose --json
displayName: "Install SFDX & plugins"

# Login & Deploy sfdx sources to related org (configuration: https://hardisgroupcom.github.io/sfdx-hardis/salesforce-ci-cd-setup-auth/ )
- script: |
sfdx hardis:auth:login
sfdx hardis:project:deploy:sources:dx
sf hardis:auth:login
sf hardis:project:deploy:sources:dx
env:
SFDX_CLIENT_ID_INTEGRATION: $(SFDX_CLIENT_ID_INTEGRATION)
SFDX_CLIENT_KEY_INTEGRATION: $(SFDX_CLIENT_KEY_INTEGRATION)
Expand Down
20 changes: 10 additions & 10 deletions defaults/ci/bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ pipelines:
script:
- npm install --no-cache @salesforce/cli --global
- sf plugins install @salesforce/plugin-packaging
- echo 'y' | sfdx plugins:install sfdx-hardis
- echo 'y' | sfdx plugins:install sfdx-essentials
- echo 'y' | sfdx plugins:install sfdx-git-delta
- echo 'y' | sf plugins:install sfdx-hardis
- echo 'y' | sf plugins:install sfdx-essentials
- echo 'y' | sf plugins:install sfdx-git-delta
- sf version --verbose --json
- export BRANCH_NAME=$(echo "$BITBUCKET_PR_DESTINATION_BRANCH" | sed 's/refs\/heads\///')
- export CI_COMMIT_REF_NAME=$BRANCH_NAME
- export ORG_ALIAS=$BRANCH_NAME
- export CONFIG_BRANCH=$BRANCH_NAME
- export FORCE_COLOR=1
- sfdx hardis:auth:login
- sfdx hardis:project:deploy:sources:dx --check
- sf hardis:auth:login
- sf hardis:project:deploy:sources:dx --check

branches:
# Add all your major branches here
Expand All @@ -44,14 +44,14 @@ pipelines:
script:
- npm install --no-cache @salesforce/cli --global
- sf plugins install @salesforce/plugin-packaging
- echo 'y' | sfdx plugins:install sfdx-hardis
- echo 'y' | sfdx plugins:install sfdx-essentials
- echo 'y' | sfdx plugins:install sfdx-git-delta
- echo 'y' | sf plugins:install sfdx-hardis
- echo 'y' | sf plugins:install sfdx-essentials
- echo 'y' | sf plugins:install sfdx-git-delta
- sf version --verbose --json
- export BRANCH_NAME=$(echo "$BITBUCKET_BRANCH" | sed 's/refs\/heads\///')
- export CI_COMMIT_REF_NAME=$BRANCH_NAME
- export CONFIG_BRANCH=$BRANCH_NAME
- export ORG_ALIAS=$BRANCH_NAME
- export FORCE_COLOR=1
- sfdx hardis:auth:login
- sfdx hardis:project:deploy:sources:dx
- sf hardis:auth:login
- sf hardis:project:deploy:sources:dx
4 changes: 2 additions & 2 deletions defaults/mkdocs/.github/workflows/build-deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
- run: yarn
- run: yarn prepack
- run: npm i @salesforce/cli -g
- run: echo y|sfdx plugins:install sfdx-hardis
- run: sfdx hardis:doc:plugin:generate
- run: echo y|sf plugins:install sfdx-hardis
- run: sf hardis:doc:plugin:generate
# Deploy docs with mkdocs-material
- uses: actions/setup-python@v2
with:
Expand Down
30 changes: 15 additions & 15 deletions defaults/monitoring/.github/workflows/org-monitoring.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ jobs:
run: |
npm install --no-cache @salesforce/cli --global
sf plugins install @salesforce/plugin-packaging
echo 'y' | sfdx plugins:install sfdx-hardis
echo 'y' | sfdx plugins:install sfdx-essentials
echo 'y' | sfdx plugins:install sfdx-git-delta
echo 'y' | sf plugins:install sfdx-hardis
echo 'y' | sf plugins:install sfdx-essentials
echo 'y' | sf plugins:install sfdx-git-delta
sf version --verbose --json
# Login & check deploy with test classes & code coverage
- name: Login & Retrieve Metadata
Expand All @@ -69,8 +69,8 @@ jobs:
FORCE_COLOR: "1"
run: |
echo "Monitoring sfdx-hardis: Metadata Backup for \"$CONFIG_BRANCH\""
sfdx hardis:auth:login
sfdx hardis:org:monitor:backup
sf hardis:auth:login
sf hardis:org:monitor:backup

# Push new commit if applicable
# (for now works only on PR from same repository, not from forks)
Expand Down Expand Up @@ -117,9 +117,9 @@ jobs:
run: |
npm install --no-cache @salesforce/cli --global
sf plugins install @salesforce/plugin-packaging
echo 'y' | sfdx plugins:install sfdx-hardis
echo 'y' | sfdx plugins:install sfdx-essentials
echo 'y' | sfdx plugins:install sfdx-git-delta
echo 'y' | sf plugins:install sfdx-hardis
echo 'y' | sf plugins:install sfdx-essentials
echo 'y' | sf plugins:install sfdx-git-delta
sf version --verbose --json
# Login & check deploy with test classes & code coverage
- name: Login & Run apex tests
Expand All @@ -140,8 +140,8 @@ jobs:
run: |
echo "Run apex tests against \"$CONFIG_BRANCH\""
git pull origin ${{ env.BRANCH }}
sfdx hardis:auth:login
sfdx hardis:org:test:apex
sf hardis:auth:login
sf hardis:org:test:apex

- name: Upload artifacts
if: success() || failure()
Expand Down Expand Up @@ -215,9 +215,9 @@ jobs:
run: |
npm install --no-cache @salesforce/cli --global
sf plugins install @salesforce/plugin-packaging
echo 'y' | sfdx plugins:install sfdx-hardis
echo 'y' | sfdx plugins:install sfdx-essentials
echo 'y' | sfdx plugins:install sfdx-git-delta
echo 'y' | sf plugins:install sfdx-hardis
echo 'y' | sf plugins:install sfdx-essentials
echo 'y' | sf plugins:install sfdx-git-delta
sf version --verbose --json
# Login & check deploy with test classes & code coverage
- name: Login & Run monitoring checks
Expand All @@ -238,8 +238,8 @@ jobs:
run: |
echo "Run Monitoring checks against \"$CONFIG_BRANCH\""
git pull origin ${{ env.BRANCH }}
sfdx hardis:auth:login
sfdx hardis:org:monitor:all
sf hardis:auth:login
sf hardis:org:monitor:all

- name: Upload artifacts
if: success() || failure()
Expand Down
Loading