Information for:

# Skipping certain files when staging a factory¶

Skipping files during site staging can be used for different scenarios, including:

• To skip all files during staging, select the Skip Site Files checkbox in the staging workflow. You do not need to make any code changes.
• To only skip certain files during staging, this can be done by either:

Whether you decide to use an ignore file or the Skip site files override textbox, the pattern is the same. Each pattern must be:

• Separated by a new line in the file and the override text field.
• Compatible with the rsync utility, similar to .gitignore file patterns.
• Relative to the sites’ files directory, such as /mnt/files/<docroot>.<environment>/sites/g/files/<sitedbidentifier><siteid>/

For example, an .acsfstageignore file would look like:

files/staging-file-to-skip1.txt
files/staging-files-with-pattern*


Here, the pattern skips the staging-file-to-skip1.txt file and all the files matching the staging-files-with-pattern* pattern residing in the /mnt/files/<docroot>.<environment>/sites/g/files/<sitedbidentifier><siteid>/files/ folder. The Skip site files override textbox follows the exact same syntax and pattern structure.

## Using an ignore file¶

With the .acsfstageignore file, you can determine the files that should be skipped. This file must contain a list of file patterns and live in the root of the git repository in the deployed production codebase. This file skipping approach is effective for regular staging operations when there are a standard set of files or directories that are skipped for most staging operations. The .acsfstageignore file provides a way of keeping these patterns in the codebase when the files that need skipping are not changed often.

Important

• The .acsfstageignore file must be committed to the git repository. Therefore, any changes to this file requires a code release in production.
• Site Factory does not take the ignore file into consideration if the Skip site files override textbox is populated while configuring a staging operation.

## Skip site files override user interface textbox¶

The Skip site files override textbox field in the user interface enables you to override the .acsfstageignore file while configuring a staging operation from the dashboard. This is used to:

• Skip different sets of files.
• Skip a unique set of files for a single staging.

The Skip site files override operation follows the exact same syntax and pattern structure as the ignore file.

Important

If the Skip site files override field is populated, the patterns included in the .acsfstageignore file is ignored.

Note

When using the .acsfstageignore file or the Skip site files override textbox, all files on the non-production environment are deleted. The files that do not match the patterns are synced from production.