cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

DATABRICKS CLI SYNC SPECIFIC FILES

carlos_tasayco
Contributor

Hello,

I am struggling with this problem I need to update databricks repo, to only sync some files according to documentation is possible:
https://learn.microsoft.com/en-us/azure/databricks/dev-tools/cli/sync-commands#only-sync-specific-fi...

carlos_tasayco_0-1751310427720.png

In my workflow I am updating creating my .gitignore file but is syncing all the files not the specific files this ismy code:

- name: Generate .gitignore inside release folder
run: |
echo ".databricks" > "./.release/databricks-1.0.221/.gitignore"
echo ".github/pylintrc" >> "./.release/databricks-1.0.221/.gitignore"
echo "📝 Final .gitignore content:"
cat "./.release/databricks-1.0.221/.gitignore"

- name: Perform selective sync using --include-from
env:
DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }}
DATABRICKS_TOKEN: ${{ env.DATABRICKS_TOKEN }}
run: |
INNER_FOLDER=$(find "${RELEASE_FOLDER}" -mindepth 1 -maxdepth 1 -type d)
INCLUDE_FILE="$INNER_FOLDER/.gitignore"
echo "🔍 INNER_FOLDER = $INNER_FOLDER"
echo "📄 INCLUDE_FILE = $INCLUDE_FILE"
echo "📁 REPO_PATH = $REPO_PATH"
echo "📝 Command: databricks sync \"$INNER_FOLDER\" \"$REPO_PATH\" --include-from \"$INCLUDE_FILE\""

databricks sync "$INNER_FOLDER" "$REPO_PATH" --include-from "./.release/databricks-1.0.221/.gitignore"

I only should be able to sync this file "github/pylintrc""  because is what I put in the gitignore
However is syncing all the files under that path

carlos_tasayco_1-1751310545234.png



Any help is welcomed



0 REPLIES 0