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

Adding CICD Branch out to new workspace pdf and associated scripts #27

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger: none

parameters:
- name: source_workspace
displayName: Enter source workspace
type: string
default: 'Dev_WS_CICDSample_3'

- name: target_workspace
displayName: Enter target workspace name
type: string
default: 'Dev_WS_CICDSample_Clone5'

- name: copy_lakehouse_data
displayName: Copy Lakehouse Data (enter True or False)
type: string
default: 'True'

- name: copy_warehouse_data
displayName: Copy Lakehouse Data (enter True or False)
type: string
default: 'False'

- name: create_lakehouse_shortcuts
displayName: Create lakehouse shortcuts (only if copy lakehouse data set to False)
type: string
default: 'False'

- name: developer_email
displayName: Enter developer email
type: string
default: '[email protected]'

- name: capacity_id
displayName: Enter capacity ID of the new workspace
type: string
default: 'B34D9528-0FF8-4E40-865D-8BA769F574BB'


- name: ado_branch
displayName: Enter the source branch name
type: string
default: 'main'

- name: connections_from_to
displayName: Swap connections in pipelines using names or IDs in the format (from,to) format
type: string
default: "('4498340c-27cf-4c6e-a025-00e5de6b0726','4498340c-27cf-4c6e-a025-00e5de6b0726')"

variables:
- group: Fabric_Deployment_Group_S
- group: Fabric_Deployment_Group_NS

pool:
name: Azure Pipelines

stages:
- stage: CreateWorkspace
jobs:
- job: 'BranchOut'
steps:

- script: pip install requests
displayName: 'Install requests'
- script: pip install msal
displayName: 'Install msal'
- script: |
echo Add other tasks to build, test, and deploy your project.
echo See https://aka.ms/yaml

- task: PythonScript@0
inputs:
scriptSource: 'filePath'
scriptPath: 'scripts/BranchOut-Feature-Workspace-Automation.py'
arguments: '--ADO_ORG_NAME $(ADO_ORG_NAME) --ADO_REPO_NAME $(ADO_REPO_NAME) --ADO_PROJECT_NAME $(ADO_PROJECT_NAME) --ADO_NEW_BRANCH ${{ parameters.target_workspace}} --DEVELOPER ${{ parameters.developer_email }} --WORKSPACE_NAME ${{ parameters.target_workspace }} --CAPACITY_ID ${{ parameters.capacity_id }} --ADO_API_URL $(ADO_API_URL) --ADO_MAIN_BRANCH ${{ parameters.ado_branch }} --TENANT_ID $(TENANT_ID) --FABRIC_TOKEN $(fabrictoken) --ADO_PAT_TOKEN $(azdopat) --CLIENT_ID $(azclientid) --USER_NAME $(username) --PASSWORD $(password)'
#failOnStderr: true
displayName: 'Run Branch-Out-To-New-Workspace Script'

- task: PythonScript@0
inputs:
scriptSource: 'filePath'
scriptPath: 'scripts/Run_post_activity.py'
arguments: '--FABRIC_TOKEN $(fabrictoken) --NOTEBOOK_WORKSPACE_ID $(NOTEBOOK_WORKSPACE_ID) --NOTEBOOK_ID $(NOTEBOOK_ID) --SOURCE_WORKSPACE ${{ parameters.source_workspace }} --TARGET_WORKSPACE ${{ parameters.target_workspace }} --TENANT_ID $(TENANT_ID) --COPY_LAKEHOUSE ${{ parameters.copy_lakehouse_data }} --COPY_WAREHOUSE ${{ parameters.copy_warehouse_data }} --CREATE_SHORTCUTS ${{ parameters.create_lakehouse_shortcuts }} --USER_NAME $(username) --PASSWORD $(password) --CLIENT_ID $(azclientid) --CONNECTIONS_FROM_TO ${{ parameters.connections_from_to }}'
#failOnStderr: true
displayName: 'Invoke Fabric Post Activity Job'


Loading