-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #473 from Sitecore/230-devops-promote-change
Changed XMC DevOps process to use Promote
- Loading branch information
Showing
3 changed files
with
61 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Promote an XM Cloud deployment to a different environment. | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
environmentName: | ||
required: true | ||
type: string | ||
deploymentId: | ||
required: true | ||
type: string | ||
secrets: | ||
XM_CLOUD_CLIENT_ID: | ||
required: true | ||
XM_CLOUD_CLIENT_SECRET: | ||
required: true | ||
XM_CLOUD_ENVIRONMENT_ID: | ||
required: true | ||
|
||
jobs: | ||
|
||
deploy: | ||
name: Promoting XM Cloud Deployment ${{ inputs.deploymentId }} to ${{ inputs.environmentName }} Site | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-dotnet@v2 | ||
with: | ||
dotnet-version: '6.0.x' | ||
- run: dotnet tool restore | ||
- run: dotnet sitecore --help | ||
- name: Authenticate CLI with XM Cloud | ||
run: dotnet sitecore cloud login --client-credentials --client-id ${{ secrets.XM_CLOUD_CLIENT_ID }} --client-secret ${{ secrets.XM_CLOUD_CLIENT_SECRET }} --allow-write | ||
- name: Deploy the CM assets to XM Cloud | ||
run: | | ||
result=$(dotnet sitecore cloud environment promote --environment-id ${{ secrets.XM_CLOUD_ENVIRONMENT_ID }} --source-id ${{ inputs.deploymentId }} --json) | ||
echo $result | ||
isTimedOut=$(echo $result | jq ' .IsTimedOut') | ||
isCompleted=$(echo $result | jq ' .IsCompleted') | ||
if [ $isTimedOut = true ] | ||
then | ||
echo "Operation Timed Out." | ||
exit -1 | ||
fi | ||
if ! [ $isCompleted = true ] | ||
then | ||
echo "Operation Failed." | ||
exit -1 | ||
fi | ||
echo "Deployment Completed" |