Skip to content

Schemachange version 4.0.0 not picking up variable User from created connections.toml file #317

@BlessingZondi

Description

@BlessingZondi

With the recent update of schemachange to version 4 and requiring to use a connections.toml file for authentication, it seems as though schemachange is not picking up variables created and populated in the connections.toml file.

My yml script creates the connections.toml file in the current working directory of the pipeline in azure devops and within the same script I have tried to validate if the file is created and what is the current working dir of where the file is created and also the contents of the file, all of this is handled by the script and the script displays all these details (the displaying of contents of the file was a way of testing and validating if the file is indeed created and populated).

I am not sure if the manner at which I pass these variables to schemachange is incorrect or if there is any other thing that is incorrect in my yml script. If anyone can assist? Maybe I could be missing something!

Below is the yml script that I have tried to put together:
trigger:
branches:
include:
- main
paths:
include:
- /Migrations
pool:
vmImage: 'ubuntu-latest'

variables:

  • group: sf_insure_var

steps:

  • task: UsePythonVersion@0
    inputs:
    versionSpec: '3.x'
    addToPath: true

  • script: |
    python -m pip install --upgrade pip
    pip install schemachange
    displayName: 'Install schemachange'

  • script: |
    echo "Creating connections.toml file"
    echo "[connections.sta_prod]" > connections.toml
    echo "user = '$(user)'" >> connections.toml
    echo "password = '$(password)'" >> connections.toml
    echo "account = '$(account)'" >> connections.toml
    echo "warehouse = '$(warehouse)'" >> connections.toml
    echo "database = '$(database)'" >> connections.toml
    echo "schema = '$(schema)'" >> connections.toml
    echo "role = '$(role)'" >> connections.toml

    echo "Current working directory:"
    pwd
    echo "Listing directory contents:"
    ls -al
    echo "Contents of connections.toml:"
    cat connections.toml
    displayName: 'Validate connections.toml file creation and directory'

  • script: |
    schemachange -f $(System.DefaultWorkingDirectory) -c $(System.DefaultWorkingDirectory)/connections.toml -a sta_prod
    displayName: 'Run schemachange'

Metadata

Metadata

Assignees

No one assigned

    Labels

    WorkaroundIssues that can be addressed via a workaroundquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions