Ignoring files: .tfyignore

While building your source, you may want to ignore specific file patterns (as we specify in .gitignore). You can create a .tfyignore file in the directory where you have the deployment script.

This .tfyignore file follows the same rule specified by the .gitignore file.

If your repository is already a git repository and has a .gitignore file, then you do not specifically need to create a .tfyignore file as we will automatically detect the files to ignore.

Examples

Consider that we have the following directory structure:

.
├── .tfyignore
├── main.py
├── deploy.py
├── requirements.txt
├── notes.txt
├── logs/
│   └── local.log
└── data/
    ├── file1.csv
    ├── file2.csv
    └── vocab.txt

And our .tfyignore contains:

# ignore a file
notes.txt

# ignore files by pattern: https://git-scm.com/docs/gitignore#_pattern_format
*.py[cod]

# ignore a directory
logs/

# ignore a directory except for some files
data/*
!data/vocab.txt

When we try to build the source and deploy it, the following files will be added having a directory structure:

├── main.py
├── deploy.py
├── requirements.txt
└── data/
    └── vocab.txt

Note: If we had the .gitignore file instead of the .tfyignore file, the results would have been the same.

Note: It is important to note that when deploying your application, .tfyignore should be at the project's root (same path as deploy.py). Consider the following example:

.
├── .tfyignore
├── main.py
├── deploy.py
├── requirements.txt
└── models/
    └── .tfyignore

In the above example, servicefoundry would parse the .tfyignore file in the project's root and not in ./models/.tfyignore.