Class S3SyncProcessor

All Implemented Interfaces:
DeploymentProcessor, InitializableByConfigBean, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware

public class S3SyncProcessor extends AbstractS3Processor
Implementation of DeploymentProcessor that syncs files to an AWS S3 Bucket
Since:
3.1.0
Author:
joseross
  • Field Details

    • CONFIG_KEY_IGNORE_BLOBS

      public static final String CONFIG_KEY_IGNORE_BLOBS
      See Also:
    • localRepoUrl

      protected String localRepoUrl
      URL for the local git repository
    • blobExtension

      protected String blobExtension
      The extension used for blob files in the repository
    • ignoreBlobs

      protected boolean ignoreBlobs
      Indicates if blob files should not be uploaded to S3
  • Constructor Details

    • S3SyncProcessor

      @ConstructorProperties({"threadPoolTaskExecutor","localRepoUrl","blobExtension"}) public S3SyncProcessor(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor threadPoolTaskExecutor, String localRepoUrl, String blobExtension)
  • Method Details

    • doInit

      protected void doInit(org.apache.commons.configuration2.Configuration config) throws org.craftercms.commons.config.ConfigurationException
      Description copied from class: AbstractS3Processor
      Allows extending classes perform any custom initialization
      Overrides:
      doInit in class AbstractS3Processor
      Parameters:
      config - the bean's configuration
      Throws:
      org.craftercms.commons.config.ConfigurationException - if there's configuration related exception
    • shouldIncludeFile

      protected boolean shouldIncludeFile(String file)
      Overrides:
      shouldIncludeFile in class AbstractDeploymentProcessor
    • doMainProcess

      protected ChangeSet doMainProcess(Deployment deployment, ProcessorExecution execution, ChangeSet filteredChangeSet, ChangeSet originalChangeSet) throws DeployerException
      Performs the actual work of processing the files in the ChangeSet, it is also possible to return a new ChangeSet to be used for the following processors in the pipeline
      Specified by:
      doMainProcess in class AbstractMainDeploymentProcessor
      Parameters:
      deployment - the current deployment
      execution - the current execution
      filteredChangeSet - the filtered change set (as returned by AbstractDeploymentProcessor.getFilteredChangeSet(ChangeSet))
      originalChangeSet - the original change set (as returned by the previous processors in the pipeline)
      Returns:
      a new ChangeSet or null
      Throws:
      DeployerException - if there is any error processing the ChangeSet
    • uploadFiles

      protected void uploadFiles(software.amazon.awssdk.services.s3.S3AsyncClient client, List<String> paths) throws DeployerException
      Performs the upload of the given files.
      Parameters:
      client - AWS S3 async client
      paths - list of files to upload
      Throws:
      DeployerException - if there is any error reading or uploading the files
    • deleteFiles

      protected void deleteFiles(software.amazon.awssdk.services.s3.S3Client client, List<String> files) throws DeployerException
      Performs the delete of the given files.
      Parameters:
      client - AWS S3 client
      files - list of files to delete
      Throws:
      DeployerException - if there is any error deleting the files