Skip to content

Developing with the S3 connector

David Edwards edited this page Dec 3, 2021 · 4 revisions

The S3 connector is an .amp used by the acs-packaging project to add functionality to the alfresco-enterprise-repo. The purpose of the connector is to enable storage of binary content in S3 that is managed by Alfresco.

This guide is meant as a quick start to enable a developer to begin working on the project as quickly as possible. You will find additional documents in the alfresco-s3-connector/documentation folder if you wish for further details.

Running the project locally

The best way to run the project is to leverage the acs-packaging project. This project contains many tools to aid in development, which this guide will reference.

Prerequisites

Cloned the alfresco-s3-connector project.

The following projects should be download/cloned to the same local directory eg.

  • /c/alfresco/acs-community-packaging
  • /c/alfresco/acs-packaging
  • /c/alfresco/alfresco-community-repo
  • /c/alfresco/alfresco-enterprise-repo
  • /c/alfresco/alfresco-enterprise-share

You must have docker, with docker-compose installed.

You have a bucket in S3 you can use, along with credentials to access it:

  • Access Key
  • Secret Key

Build steps

  1. Navigate to the folder containing the prerequisite projects (i.e. /c/alfresco/)
  2. There is an alias file in acs-packaging that we will be using, enter the following: source ./acs-packaging/dev/aliases
  3. To use local versions of alfresco-community-repo and alfresco-enterprise-repo (required for debugging) use the following script: ./acs-packaging/dev/scripts/linkPoms.sh This will update the dependencies of each project with SNAPSHOT versions (on windows you will have to do this manually)
    1. (OPTIONAL) Manually updating the pom.xml The dependency order is as follows: alfresco-community-repo -> alfresco-enterprise-repo -> acs-packaging
    2. Update alfresco-community-repo references in alfresco-enterprise-repo to SNAPSHOT versions
    3. Update alfresco-enterprise-repo references in acs-packaging to SNAPSHOT versions
  4. Update the references in S3-connector
    1. This is the parent pom and should be the alfresco-enterprise-repo SNAPSHOT version
  5. Build the repository projects by running the command:entXR
  6. Build s3 project using: (cd directory/to/s3-connector && mvn clean install -DskipTests)
  7. Update the s3-connector version in acs-packaging pom.xml to the SNAPSHOT version build in previous step
  8. Add your s3 credentials to acs-packaging/dev-acs-amps-overlay. You will see 5 properties that need to be altered as appropriate:
    1. connector.s3.accessKey
    2. connector.s3.secretKey
    3. connector.s3.bucketName
    4. connector.s3.bucketRegion
    5. connector.s3.storeProtocol = s3v2
  9. You need to tell acs-packaging to use the s3-connector by exporting the variable AMPS with the needed profile: export AMPS=-Ps3
  10. Run the database, and other required services using the command: envUp
  11. You are now finally ready to run the project using: entT or with debugging: entTDebug

TLDR;

  1. Update the required pom.xml files with versions and config needed, either manually and with the script ./acs-packaging/dev/scripts/linkPoms.sh or just manually.
  2. From the root directory (in the above example /c/alfresco/) run the following commands:
  • source ./acs-packaging/dev/aliases
  • entXR
  • (cd directory/to/s3-connector && mvn clean install -DskipTests)
  • envUp (To reset your environment first run envKill && envRm
  • entT or with debugging: entTDebug
Clone this wiki locally