Skip to content
This repository was archived by the owner on Feb 18, 2024. It is now read-only.
38 changes: 16 additions & 22 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,43 @@
![image](https://gblobscdn.gitbook.com/assets%2F-MI39dIf1BuKlg_oSIG_%2F-MersLlsLMydZ6V7hfP-%2F-MersUtb9fBk1m9NMuMc%2Fflowdiagram_revised.png?alt=media&token=b613b0a8-99e3-4702-8f38-033cb1d7700d)

This repo contains the follwing YAML based Github Pipeline defintions
This repo contains the following YAML based Github Pipeline definitions

- validate.yml
- validate.yml

Pull Request Validation Pipeline, that validates incoming changes against a scratch org fetched from the pool

- quickbuild-build-deploy.yml

Pipeline that gets triggered on a merge to the trunk (main), resulting in building a set of packages, deploying to a dev sandbox ( and then build a set of validated packages and finally publish that to artifact repository
- quickbuild-deploy-build.yml

- release-build-publish.yml
Pipeline that gets triggered on a merge to the trunk (main), resulting in building a set of packages, deploying to a dev environment and then build a set of validated packages and finally publish that to artifact repository. It also creates a release definition file which concurrency used to deploy a release to desired environment (test, production, etc.)

Triggered on a merge to a release/x branch. Assumes a change has been created/tested in main/dev (quickbuild-build-deploy.yml) and needs to be included in the release via a cherry-pick to the release branch. This builds and publishes off the relase branch making it avialble for the release pipeline.
- build-patch.yml

Triggered on a merge to a release/x branch. Assumes a change has been created/tested in main/dev (quickbuild-deploy-build.yml) and needs to be included in the release via a cherry-pick to the release branch. This builds and publishes off the release branch making it available for the release pipeline. It also creates a release definition file for the patch release.

- release.yml
A release pipeline that utilizes the release defintion to fetch artifacts from artifactory and then deploy to a sandbox

A release pipeline that utilizes the release definition to fetch artifacts from artifactory and then deploy to a desired environment (test, production, etc.)


- env-operations
- prepare-ci-poool.yml
- prepare-ci-pool.yml
Pipeline to prepare command is used to build scratch org pools for CI purposes

- prepare-dev-poool.yml
- prepare-dev-pool.yml
Pipeline to prepare command is used to build scratch org pools for development

- pool-cleaner.yml
Pipeline to drop the entire pools and facilatate for recreation at end of a day
Pipeline to drop the entire pools and facilitate for recreation at end of a day

- delete-scratchorg-pool.yml
Delete a particular scratch org fetched from the pool, to be used where the devs dont have access to delete scratch orgs from command line (Free Developer License)
Delete a particular scratch org fetched from the pool, to be used where the devs dont have access to delete scratch orgs from command line (Free Developer License)


The sample pipelines utilise an azure pipelines variable group called DEVHUB which contains the following variables. As a prerequisite, this has to be setup manually
- DEVHUB_SFDX_AUTH_URL : The auth url to DevHub, You can retrieve the auth URL by following the ling here https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_auth_sfdxurl.htm
The sample pipelines utilize an azure pipelines variable group called DEVHUB which contains the following variables. As a prerequisite, this has to be setup manually

- DEV_SFDX_AUTH_URL: The auth url to Developer Sandbox, You can retrieve the auth URL by following the ling here https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_auth_sfdxurl.htm

- TEST_SFDX_AUTH_URL: The auth url to TEST Sandbox, You can retrieve the auth URL by following the ling here https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_auth_sfdxurl.htm

- ST_SFDX_AUTH_URL: The auth url to ST Sandbox, You can retrieve the auth URL by following the ling here https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_auth_sfdxurl.htm


- SIT_SFDX_AUTH_URL: The auth url to SIT Sandbox, You can retrieve the auth URL by following the ling here https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_auth_sfdxurl.htm

- UAT_SFDX_AUTH_URL: The auth url to UAT Sandbox, You can retrieve the auth URL by following the ling here https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_auth_sfdxurl.htm
- DEVHUB_SFDX_AUTH_URL: The auth url to DevHub, You can retrieve the auth URL by following the ling here https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_auth_sfdxurl.htm

- PROD_SFDX_AUTH_URL: The auth url to DevHub, You can retrieve the auth URL by following the ling here https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_auth_sfdxurl.htm
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
#----------------------------------------------------------------------------------------------------
# Maintained by @aly76 for DX@Scale
# Follows reference pipeline available at docs.dxatscale.io
#
#
#-----------------------------------------------------------------------------------------------------
# To know more about dxatscale, visit https://docs.dxatscale.io
# To know more on sfpowerscripts, visit- https://sfpowerscripts.dxatscale.io/
# To know more on sfpowerkit, visit- https://github.com/Accenture/sfpowerkit

# This pipeline builds on a release branch. Assumes you've cherry-picked a fix from master (thats been tested in DEV etc). Makes the change available for release

name: 'CI Pipeline - Release Build - Auto Triggered'
name: 'CI - Build Patch'


on:
Expand All @@ -35,13 +35,12 @@ on:

jobs:
buildAndPublish:
name: 'Build and Publish'
name: 'Build & Publish'
runs-on: ubuntu-latest
container: ghcr.io/dxatscale/sfpowerscripts
concurrency: build
if: contains(github.ref,'release') || github.ref == 'refs/heads/release/**'
concurrency: build-patch
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -50,7 +49,7 @@ jobs:
echo "${{ secrets.DEVHUB_SFDX_AUTH_URL }}" > ./authfile
sf org login sfdx-url -f authfile -a devhub

- name: 'Create packages'
- name: 'Create Packages'
id: sfpowerscripts-build
run: |
sfp orchestrator:build -v devhub --diffcheck --branch ${GITHUB_REF#refs/heads/} --buildnumber ${GITHUB_RUN_ID}
Expand All @@ -67,8 +66,21 @@ jobs:
registry-url: 'https://npm.pkg.github.com'
scope: '@${{ github.repository_owner }}'

- name: Publish
- name: 'Publish Packages'
run: |
sfp orchestrator:publish -d artifacts --npm --scope @${{ github.repository_owner }} --gittag --pushgittag
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 'Define Release'
run: |
RELEASE_NAME=${GITHUB_RUN_ID}
if [ "$RELEASE_NAME_PREFIX" != "" ]; then RELEASE_NAME="${RELEASE_NAME_PREFIX}-${GITHUB_RUN_ID}"; fi

TARGET_BRANCH="release-definition"
if [ "$RELEASE_DEF_TARGET_BRANCH" != "" ]; then TARGET_BRANCH="$RELEASE_DEF_TARGET_BRANCH"; fi

git tag -a $RELEASE_NAME -m "$RELEASE_NAME"
git push origin $RELEASE_NAME

sfp releasedefinition:generate --branchname "$TARGET_BRANCH_BANE" --gitref "$RELEASE_NAME" --configfile release-config/config.yml --releasename "$RELEASE_NAME"
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# Return an used scratch org back to the pool for replenishment

name: 'Scratch Org Recycler - User Triggered'
name: 'ENV - Delete Scratch Org'

on:
workflow_dispatch:
Expand Down
71 changes: 0 additions & 71 deletions .github/workflows/env-operations-pool-cleaner.yml

This file was deleted.

16 changes: 9 additions & 7 deletions .github/workflows/env-operations-prepare-ci-pool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
# This pipeline creates the CI pools used during validate


name: 'Replenish CI Pools - Auto Triggered'
name: 'Pool - Create - CI'

on:
workflow_dispatch:
inputs:
gitRef:
description: "Commit Id from where the pools should be created"
description: "Commit SHA from where the pools should be created"
required: false
default: 'main'
schedule:
Expand All @@ -38,14 +38,14 @@ on:
jobs:

pool-ci-pool:
name: 'Replenish CI Pool'
name: 'Create CI Pool'
runs-on: ubuntu-latest
container: ghcr.io/dxatscale/sfpowerscripts
timeout-minutes: 720 #Set to Maximum Time out

steps:

- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.gitRef }}
fetch-depth: 0
Expand All @@ -61,15 +61,17 @@ jobs:
with:
registry-url: 'https://npm.pkg.github.com'

- name: 'Drop the pool if exists'
run: 'sfp pool:delete -t ci -v devhub -a'

- name: 'Prepare a pool of scratch orgs'
run: 'sfp orchestrator:prepare -f config/project-ci-pool-def.json -v devhub'
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Publish artifacts
- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: scratchorg-logs-pool-ci
path: .sfpowerscripts/prepare_logs

path: .sfpowerscripts/prepare_logs
14 changes: 8 additions & 6 deletions .github/workflows/env-operations-prepare-dev-pool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

# This pipeline creates the DEV pools

name: 'Replenish DEV Pools - Auto Triggered'
name: 'Pool - Create - DEV'

on:
workflow_dispatch:
inputs:
gitRef:
description: "Commit Id from where the pools should be created"
description: "Commit SHA from where the pools should be created"
required: false
default: 'main'
schedule:
Expand All @@ -35,13 +35,13 @@ on:
jobs:

pool:
name: 'Replenish Dev Pool'
name: 'Create DEV Pool'
runs-on: ubuntu-latest
container: ghcr.io/dxatscale/sfpowerscripts
timeout-minutes: 720 #Set to Maximum Time out
steps:

- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.gitRef }}
fetch-depth: 0
Expand All @@ -57,6 +57,9 @@ jobs:
with:
registry-url: 'https://npm.pkg.github.com'

- name: 'Drop the pool if exists'
run: 'sfp pool:delete -t dev -v devhub -a'

- name: 'Prepare a pool of scratch orgs'
run: 'sfp orchestrator:prepare -f config/project-dev-pool-def.json -v devhub'
env:
Expand All @@ -67,5 +70,4 @@ jobs:
if: ${{ always() }}
with:
name: scratchorg-logs-pool-ci
path: .sfpowerscripts/prepare_logs

path: .sfpowerscripts/prepare_logs
2 changes: 1 addition & 1 deletion .github/workflows/env-operations-publish-pool-metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# This pipeline publishes metrics about scratch orgs to Monitoring tool every 30 minutes

name: 'Publish Metrics for Scratch Org Pools'
name: 'Pool - Publish Metrics'

on:
workflow_dispatch:
Expand Down
Loading