When the Assets Storage is enabled Squash will automatically add a new
/assets/ mount point for all deployments within the repository. You can upload up to 100GB of data in this folder (additional charges apply, check out the pricing page).
How to enable the Assets Storage¶
Pick a repository and click on “Settings”:
Enable the Assets Storage
- Click on the checkbox “Enable Assets Storage”
- Click “Save”
There are currently 3 methods to upload files to the assets storage.
1. Web Interface¶
You can upload multiple files at once, create folders, edit and delete files from this interface. Note that it takes between 1 and 3 minutes for any changes to propagate and appear on all deployments.
Note: There is a file size limit of 1 GB for files uploaded from the Web Interface. You can upload any file size (up to 100GB) using either the API or directly from Squash deployments as mentioned below.
2. From any Squash deployment¶
You just need to SSH to any running deployment and upload files (using SCP or rsync) to the
/assets/ folder, and that’s it. Your changes will automatically appear on all running deployments, within one minute or less.
Using Assets within my applications¶
There are multiple ways you can use Assets within your applications.
Using the copy_files feature in the YAML file¶
Here you would manually copy files or folders within the build process defined in the
.squash.yml file. This will essentially transfer data from the assets folder to a different location within your source tree. Then you can use the files as part of your application’s build process.
deployments: AppName1: filename: ./src/Dockerfile copy_files: - /assets/dev-dumps/ ~/code/src/
WARNING: We do not recommend changing asset files permissions or file ownership within a Docker volume. This will essentially cause these permissions to propagate to the host deployment and will also affect any active deployments using the assets folder. Another side effect is the ability to upload files from the Squash UI, uploads/updates will be automatically blocked from the Squash interface for assets folders/files with custom ownership or permissions.
You can easily associate the Assets Storage with your deployments by defining a Docker volume from your
.squash.yml file as follows:
run_options: -v /assets/pictures:/home/devel/pictures
For the example above, Squash will mount a new “pictures” folder within the “devel” home folder of all docker containers using the contents from the assets storage.
For more details, see run_options.