Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
johnforeland committed Oct 27, 2020
1 parent f55ef78 commit d6d4f18
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 16 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/helper_deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
description: "Package ID"
required: true
org:
description: "Org (prod, preprod, dev)"
description: "Org (prod, preprod, dev, uat, sit)"
required: true
jobs:
debug:
Expand Down Expand Up @@ -38,6 +38,14 @@ jobs:
then
echo "::set-output name=target::$(echo ${{ secrets.DEV_SFDX_URL }})"
echo "'dev' was set"
elif [ ${{ github.event.inputs.org }} == "uat" ]
then
echo "::set-output name=target::$(echo ${{ secrets.UAT_SFDX_URL }})"
echo "'preprod' was set"
elif [ ${{ github.event.inputs.org }} == "sit" ]
then
echo "::set-output name=target::$(echo ${{ secrets.SIT_SFDX_URL }})"
echo "'preprod' was set"
fi
# Authorize SFDX
Expand Down
56 changes: 41 additions & 15 deletions .github/workflows/push_create-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,28 +138,33 @@ jobs:
# ######################################## #
# ####### CHECK DEV SANDBOX DEPLOY ####### #
# ######################################## #
check-dev-sandbox-deploy:
name: Check if DEPLOY_TO_DEV_AFTER_PACKAGE_CREATION is true
check-sandbox-deploy:
name: Check deployment to sandbox after package creation
runs-on: ubuntu-latest
steps:
- name: check DEPLOY_TO_DEV_AFTER_PACKAGE_CREATION secret
- name: Check deployment to sandbox after package creation
id: checkSecret
run: |
echo "Enable: ${{ env.SECRET == '1' }}"
echo "::set-output name=shouldContinue::${{ env.SECRET == '1' }}"
echo "Enable: ${{ env.DEV == '1' || env.UAT == '1' }}"
echo "::set-output name=shouldContinue::${{ env.DEV == '1' || env.UAT == '1' }}"
echo "::set-output name=deployToUAT::${{ env.UAT == '1' }}"
echo "::set-output name=deployToDev::${{ env.DEV == '1' }}"
env:
SECRET: ${{ secrets.DEPLOY_TO_DEV_AFTER_PACKAGE_CREATION }}
DEV: ${{ secrets.DEPLOY_TO_DEV_AFTER_PACKAGE_CREATION }}
UAT: ${{ secrets.DEPLOY_TO_UAT_AFTER_PACKAGE_CREATION }}
outputs:
shouldContinue: ${{ steps.checkSecret.outputs.shouldContinue }}
deployToUAT: ${{ steps.checkSecret.outputs.deployToUAT }}
deployToDev: ${{ steps.checkSecret.outputs.deployToDev }}

# ######################################## #
# ######## DEPLOY PACKAGE TO DEV ######### #
# ######################################## #
deploy-package-to-dev:
name: Deploy package to dev sandbox
runs-on: ubuntu-latest
needs: [create-package, check-dev-sandbox-deploy]
if: ${{ needs.check-dev-sandbox-deploy.outputs.shouldContinue == 'true' }}
needs: [create-package, check-sandbox-deploy]
if: ${{ needs.check-sandbox-deploy.outputs.shouldContinue == 'true' }}
steps:
# Authorize SFDX
- name: Authorize SFDX
Expand All @@ -178,11 +183,20 @@ jobs:
# Authenticate dev sandbox
- name: Authenticate dev sandbox
if: ${{ needs.check-sandbox-deploy.outputs.deployToDev == 'true' }}
run: |
echo ${{ secrets.DEV_SFDX_URL}} > ./DEV_SFDX_URL.txt
sfdx force:auth:sfdxurl:store -f ./DEV_SFDX_URL.txt -a dev -s
rm -f ./DEV_SFDX_URL.txt
# Authenticate UAT sandbox
- name: Authenticate UAT sandbox
if: ${{ needs.check-sandbox-deploy.outputs.deployToUAT == 'true' }}
run: |
echo ${{ secrets.UAT_SFDX_URL}} > ./UAT_SFDX_URL.txt
sfdx force:auth:sfdxurl:store -f ./UAT_SFDX_URL.txt -a uat -s
rm -f ./UAT_SFDX_URL.txt
# Install sfpowerkit plugin used to install multiple packages only by version number
- name: "Install sfpowerkit plugin"
run: "echo y | sfdx plugins:install sfpowerkit"
Expand All @@ -198,13 +212,25 @@ jobs:
echo "::set-output name=keys::$(echo $keys)"
# Install packages this repo is dependant on
- name: "Install dependant packages"
# Install dependant packages to dev sandbox
- name: "Install dependant packages to dev sandbox"
if: ${{ needs.check-sandbox-deploy.outputs.deployToDev == 'true' }}
run: "sfdx sfpowerkit:package:dependencies:install -u dev -r -a -w 60 -k '${{ steps.install-keys.outputs.keys }}'"

# Install package in dev sandbox
# Install package in dev sandbox org
- name: "Install package in dev sandbox org"
run: "sfdx force:package:install --package ${{ needs.create-package.outputs.packageVersionId }} -k ${{ secrets.PACKAGE_KEY }} -u dev -w 10 -b 10 -r"
if: ${{ needs.check-sandbox-deploy.outputs.deployToDev == 'true' }}
run: "sfdx force:package:install --package ${{ needs.create-package.outputs.packageVersionId }} -k ${{ secrets.PACKAGE_KEY }} -u uat -w 10 -b 10 -r"

# Install dependant packages to UAT sandbox
- name: "Install dependant packages to UAT sandbox"
if: ${{ needs.check-sandbox-deploy.outputs.deployToUAT == 'true' }}
run: "sfdx sfpowerkit:package:dependencies:install -u dev -r -a -w 60 -k '${{ steps.install-keys.outputs.keys }}'"

# Install package in UAT sandbox org
- name: "Install package in UAT sandbox org"
if: ${{ needs.check-sandbox-deploy.outputs.deployToUAT == 'true' }}
run: "sfdx force:package:install --package ${{ needs.create-package.outputs.packageVersionId }} -k ${{ secrets.PACKAGE_KEY }} -u uat -w 10 -b 10 -r"

# ######################################## #
# ###### CHECK CODE COVERAGE SECRET ###### #
Expand All @@ -213,7 +239,7 @@ jobs:
name: Check valid CODECOV_TOKEN
runs-on: ubuntu-latest
steps:
- name: check CODECOV_TOKEN secret
- name: check CODECOV_TOKEN secret
id: checkSecret
run: |
echo "Enable: ${{ env.SECRET != '' }}"
Expand All @@ -232,7 +258,7 @@ jobs:
if: ${{ needs.check-code-coverage-secret.outputs.shouldContinue == 'true' }}
runs-on: ubuntu-latest
steps:
# Install SFDX
# Install SFDX
- name: Install SFDX
uses: sfdx-actions/setup-sfdx@v1

Expand All @@ -250,7 +276,7 @@ jobs:
# Create scratch org
- name: "Create scratch org"
run: sfdx force:org:create -f config/project-scratch-def.json -a scratch-org -s -d 1 --json

# Install sfpowerkit plugin used to install multiple packages only by version number
- name: "Install sfpowerkit plugin"
run: "echo y | sfdx plugins:install sfpowerkit"
Expand Down

0 comments on commit d6d4f18

Please sign in to comment.