diff --git a/azure-pipelines/databricks/templates/databricks-deploy-library-job-template.yml b/azure-pipelines/databricks/templates/databricks-deploy-library-job-template.yml index 9e1419a..c60c5f1 100644 --- a/azure-pipelines/databricks/templates/databricks-deploy-library-job-template.yml +++ b/azure-pipelines/databricks/templates/databricks-deploy-library-job-template.yml @@ -35,10 +35,13 @@ stages: azureServiceConnection: ${{ parameters.azureServiceConnection }} - script: | echo "DBFS URL ${DATABRICKS_HOST}" - echo "Delete previous versions od the library in cluster ${DATABRICKS_LIB_PATH}" - databricks fs rm -r "${DATABRICKS_LIB_PATH}/dataopslib*.whl" - echo "Copy library in cluster from ${PYPI_REPO} to ${DATABRICKS_LIB_PATH}" - databricks fs cp --overwrite -r "${PYPI_REPO}" "${DATABRICKS_LIB_PATH}" + echo "Move previous versions of the library in cluster from ${DATABRICKS_LIB_PATH}/new_version/ ${DATABRICKS_LIB_PATH}/old_version" + databricks fs mkdirs "${DATABRICKS_LIB_PATH}/old_version" + databricks fs mkdirs "${DATABRICKS_LIB_PATH}/new_version" + databricks fs cp --overwrite -r "${DATABRICKS_LIB_PATH}/new_version/" "${DATABRICKS_LIB_PATH}/old_version/" + databricks fs rm -r "${DATABRICKS_LIB_PATH}/new_version/dataops*.whl" + echo "Copy library in cluster from ${PYPI_REPO} to ${DATABRICKS_LIB_PATH}/new_version/" + databricks fs cp --overwrite -r "${PYPI_REPO}" "${DATABRICKS_LIB_PATH}/new_version/" env: DATABRICKS_HOST: https://$(databricksWorkspaceUrl) DATABRICKS_TOKEN: $(DATABRICKS_TOKEN) diff --git a/azure-pipelines/lib/templates/lib-build-publish.yml b/azure-pipelines/lib/templates/lib-build-publish.yml index acda2ec..4a4d68b 100644 --- a/azure-pipelines/lib/templates/lib-build-publish.yml +++ b/azure-pipelines/lib/templates/lib-build-publish.yml @@ -1,4 +1,3 @@ - parameters: - name: libraryDirectory type: string @@ -142,9 +141,14 @@ jobs: - script: | python setup.py bdist_wheel + ls dist/ + file=$(ls dist/) + echo "$file" + az pipelines variable-group variable update --group-id $groupId --name VERSION --value "$file" displayName: "Build the library" workingDirectory: ${{ parameters.libraryDirectory }} env: + groupId: $(variable_group_id) package_version: $(package_version) - task: TwineAuthenticate@0 @@ -156,11 +160,11 @@ jobs: workingDirectory: ${{ parameters.libraryDirectory }} displayName: "Publish the library" - - script: | + - script: | az pipelines variable-group variable update --group-id $groupId --name MINOR --value $minor az pipelines variable-group variable update --group-id $groupId --name PATCH --value $patch displayName: "Update versions on variable group" env: groupId: $(variable_group_id) minor: $(minor) - patch: $(patch) + patch: $(patch) \ No newline at end of file diff --git a/quickstart/scripts/modules/AzureDevOps.psm1 b/quickstart/scripts/modules/AzureDevOps.psm1 index 9fa8b9e..be8eb00 100644 --- a/quickstart/scripts/modules/AzureDevOps.psm1 +++ b/quickstart/scripts/modules/AzureDevOps.psm1 @@ -17,6 +17,7 @@ function CreateAzDevOpsVariableGroups { CreateAzureDevOpsVariable -VariableGroupName "lib-versions" -AzureDevOpsOrganizationURI $RepoConfiguration.AzureDevOpsOrganizationURI -AzureDevOpsProject $RepoConfiguration.AzureDevOpsProject -VariableName "MAJOR" -VariableValue "0" CreateAzureDevOpsVariable -VariableGroupName "lib-versions" -AzureDevOpsOrganizationURI $RepoConfiguration.AzureDevOpsOrganizationURI -AzureDevOpsProject $RepoConfiguration.AzureDevOpsProject -VariableName "MINOR" -VariableValue "1" CreateAzureDevOpsVariable -VariableGroupName "lib-versions" -AzureDevOpsOrganizationURI $RepoConfiguration.AzureDevOpsOrganizationURI -AzureDevOpsProject $RepoConfiguration.AzureDevOpsProject -VariableName "PATCH" -VariableValue "0" + CreateAzureDevOpsVariable -VariableGroupName "lib-versions" -AzureDevOpsOrganizationURI $RepoConfiguration.AzureDevOpsOrganizationURI -AzureDevOpsProject $RepoConfiguration.AzureDevOpsProject -VariableName "VERSION" -VariableValue "" } function GetAzureDevOpsVariableGroup {