Synchronize git repositories
The external resources are fetched from git repositories maintained by the customers and stored in AWS S3 buckets managed by Onegini. There is a dedicated service that synchronizes git repositories with S3 buckets referred to as a synchronization service.
Synchronization service
The synchronization service uses git client to connect to the git repository and clone the single reference of the repository into S3 bucket. In order to limit the data processing a shallow clone of a specific branch/tag is performed.
The synchronization service is: - stateless - all the parameters are passed in as an input - short-running - a single call synchronizes a single repository - ran occasionally
Parameters
Name | Description |
---|---|
instanceId | customer identifier |
repository | url to customer git repository |
selectedReference | selected branch/tag |
username | Git username |
password | Git password/personal token |
When no authorization is needed in specific git repo username & password parameters don't need to be provided.
Triggering the service
The service can be triggered one-time or periodically by Admin App.
One-time execution
The service can be triggered on demand via Admin UI/ API. The admin has a persistence layer that stores the configuration for each customer/ environment. This configuration required for a specific run is passed to synchronization service as parameters.
Scheduler
This is similar to one-time execution, but in this case the Admin UI/ API does not trigger the lambda itself. Instead it creates a CloudWatch Rules that is responsible for running the synchronization service according to the schedule. This allows to ensure the system works even if Admin App is temporarily down.