Add Assets ========== In Cascade, an Asset is defined as any object or directory your application needs or delivers that is not a part of your code repository and does not reside in a database but needs to reside logically somewhere in the codebase or web root for the application to work correctly. The Assets are part of the project and may be moved around the hosted environments with a click of a button. The Assets in a project are made "live" in each environment by placing a symbolic link to them in the target environment. Example uses of the Assets feature: * The wp-uploads directory in a Wordpress system * The sites/default/files directory in a Drupal system * Vendor directory for Composer libraries not stored in Git .. note: screenshot starting width: 1200 x 675 or 1200 x 900 .. |Assets Icon| image:: ../../../shared/images/v2.6.2/portal/icon_assets.jpg :height: 16 :align: middle :alt: Open the Assets settings .. |Project Assets| image:: ../../../shared/images/v2.6.2/portal/project_assets.jpg :width: 400 :alt: Show the Assets settings for the project .. |Project Assets Disabled| image:: ../../../shared/images/v2.6.2/portal/project_assets_disabled.jpg :width: 400 :alt: The Assets feature is disabled .. |Project Assets Example| image:: ../../../shared/images/v2.6.2/portal/project_assets_example.jpg :width: 400 :alt: An example of assets configured for Drupal public and private uploads Prerequisites +++++++++++++ You will need to log into Cascade as a Project Administrator to configure Assets. To check your permissions, please navigate to the overview page of the project you wish to modify. If your display does not include the Assets icon ( |Assets Icon| ) in the left toolbar, your account does not have sufficient privileges to proceed. If you click the Assets icon, you should see the Assets configuration page. |Project Assets| In addition to the correct permissions in Cascade, in order to transfer pre-existing assets to your hosting system, additional access to the file systems is required. This tooling and access layer is managed by Contegix. If you have questions or need access please contact your project technical lead or Contegix support to request access to upload files. .. _TASK Enable Assets: Enable Assets +++++++++++++ Please navigate to the overview page of the project you wish to modify and click the Assets icon ( |Assets Icon| ) in the left toolbar. If assets are not currently enabled you will see a page like below. |Project Assets Disabled| #. Uncheck the checkbox titled "This project does not use assets" to enable assets. #. Click the Save button in the banner that appears in the navigation area. .. _TASK Add Additional Assets: Add Additional Assets +++++++++++++++++++++ Please navigate to the overview page of the project you wish to modify and click the Assets icon ( |Assets Icon| ) in the left toolbar. Take note of any instruction provided at the top of the page and keep in mind that Assets are managed in groups because each Cascade project is connected to multiple environments, each one with their own copy of the Assets to use. *Note:* You can add as many asset groups as your application needs by repeating the instructions below. To access these additional assets there is a pager provided to the right of the add button or on the margin of each asset group. Step 1: Enter a name -------------------- #. Click the + to open the add asset group form. #. Fill in the Asset Group name field. Step 2: Adjust assets per environment ------------------------------------- For each environment in the asset group, do the following: #. Adjust the Asset Path to be the relative path within the project webroot where the project expects the asset to served from. Take note of the following conditions expected on successful deployment of the asset: #. The resulting symbolic link will point to the Asset Storage Mount configured for that environment. #. The last component of this path will be the name of the symbolic link. #. The remainder of the path will decide what directory the link will be placed in. #. Adjust the Asset Storage Mount to be the absolute path outside the project webroot where the actual files are stored. * Take note of these paths, as, you will be required to migrate your project assets into this path for the first environment in your workflow. #. A banner with a save button will appear at the top of the page when changes are detected. #. Click the save button in the banner to submit the form. |Project Assets Example| Step 3: Initialize assets ------------------------- The final step is to initialize the assets. #. Navigate to the project overview dashboard. #. For each environment listed, find the "Initialize" button for each asset and click it to create an empty asset at the path specified by the value of Asset Storage Mount. #. Since all your assets should be empty at this phase, you can choose any environment for the FROM value. Be sure the to value is the environment you clicked. Step 4: Migrate Assets (optional) --------------------------------- For projects just staring out and/or having their own system for managing assets, this step may be unnecessary. For pre-existing project or continuing efforts, data migration will be necessary to seed the hosting environments initially. As mentioned previously in this guide, uploading the project assets to your hosting system is handled through conventional means, and access to those endpoints is handled by Contegix support. We have support for SFTP, Rsync, and other common tools. Please refer to the documentation provided to you and reach out to support if you have any questions.