i try to convert a github actions in order to use schemachange from snowflake, into a bit bucket pipeline this is my github actions :
# Deploy database changes using schemachange
# https://github.com/Snowflake-Labs/schemachange
# (see https://aka.ms/yaml for the YAML schema reference)
on:
push:
branches:
- main
paths:
- 'script/**'
jobs:
build:
runs-on: ubuntu-latest
env:
PROJECT_FOLDER: ${{ github.workspace }}
SF_ACCOUNT: ${{ secrets.SF_ACCOUNT }}
SF_USERNAME: ${{ secrets.SF_USERNAME }}
SF_ROLE: ${{ secrets.SF_ROLE }}
SF_WAREHOUSE: ${{ secrets.SF_WAREHOUSE }}
SF_DATABASE: ${{ secrets.SF_DATABASE }}
SNOWFLAKE_PASSWORD: ${{ secrets.SF_PASSWORD }}
YOUR_PERSONAL_ACCESS_TOKEN : ${{ secrets.YOUR_PERSONAL_ACCESS_TOKEN }}
steps:
- name: 'Use Python 3.8.x'
uses: actions/setup-python@v2
with:
python-version: '3.8.x'
- name: 'Checkout repository'
uses: actions/checkout@v2
- name: 'Install schemachange'
run: |
echo 'Starting bash task'
echo "PROJECT_FOLDER ${{ env.PROJECT_FOLDER }}"
python --version
echo 'Step 1: Installing schemachange'
pip install schemachange --upgrade
echo 'Step 2: Running schemachange'
schemachange -f ${{ env.PROJECT_FOLDER }}/script -a ${{ secrets.SF_ACCOUNT }} -u ${{ secrets.SF_USERNAME }} -r ${{ secrets.SF_ROLE }} -w ${{ secrets.SF_WAREHOUSE }} -d ${{ secrets.SF_DATABASE }} -c ${{ secrets.SF_DATABASE }}.SCHEMACHANGE.CHANGE_HISTORY_PROD --create-change-history-table --vars '{"database_name": "PROD", "schema_name": "PUBLIC"}'
this is my version in bitbucket :
pipelines:
branches:
main:
- step:
name: Deploy database changes
image: python:3.8
script:
- echo 'Starting bash task'
- echo "PROJECT_FOLDER $BITBUCKET_CLONE_DIR"
- python --version
- echo 'Step 1: Installing schemachange'
- pip install schemachange --upgrade
- echo 'Step 2: Running schemachange'
- >
schemachange -f $BITBUCKET_CLONE_DIR/script -a $SF_ACCOUNT -u $SF_USERNAME -r $SF_ROLE -w $SF_WAREHOUSE -d TECH_PROD -c TECH_PROD.SCHEMACHANGE.CHANGE_HISTORY --create-change-history-table --vars '{"ENV" : "PROD"}'
services:
- docker
definitions:
services:
docker:
memory: 2048
i have this issue :
bad intentation of a sequences entry for this statement --vars '{"ENV" : "PROD"}'
i try to replace “>” by “|” but i still have the same issue.
How can i resolve this issue ?
Thanks in advance,
François