GitHub Repo Sync Worker: Payload Template Schema¶
In this section, we discuss the GitHub Repo Sync worker templates. The GitHub Repo Sync worker is a SINGLE_INVOCATION
worker, and does not require any AWS account on the account index.
Template Schema¶
Here is an example of the schema:
TemplateName: NameOfYourTemplate
TemplateDescription: Syncs the REPO-NAME to the BUCKET-NAME
Organization: YOUR-ORG-NAME-HERE
Repository: THE-REPO-HERE
BranchName: THE-BRANCH-NAME-HERE
GitHubAppId: "The GitHub App Id -- need to wrap in quotes as it's technically a number but this needs to be a string"
GitHubInstallationId: "The GitHub Installation ID -- ditto about wrapping in quotes"
BucketName: YOUR-S3-BUCKET
BucketRegion: S3 BUCKET REGION HERE
ExtractZipContents: True # See below for details
DeleteMissingFiles: True # See below for details
# https://www.regexpal.com/ is your friend
ExcludeRepoPaths:
- "^testing\/.+$" # Excluding the `testing/` path
- "^README.md$"
- "^.github\/.+$"
- "^.gitignore$"
Below are the required fields that this worker needs:
Organization
- This is the name of the GitHub organization that the repository resides in. Note: This must be the same exact value (case sensitive) that is in the Secret to reference the GitHub App private key.Repository
- This is the name of the repository to sync. You need to make sure that the GitHub App has permissions to download this repo.BranchName
- This is the name of the branch that you want to sync. Typically, this would bemain
ormaster
.GitHubAppId
- This is the Application ID (documented in the GitHub App Configuration page). Wrap it in quotes because it's a numerical string.GitHubInstallationId
- This is the Installation ID (documented in the GitHub App Configuration page). Wrap it in quotes because it's a numerical string.BucketName
- This is the name of the S3 bucket you want to sync withBucketRegion
- This is the region that the bucket resides inExtractZipContents
- Boolean - This indicates whether or not the downloaded.zip
file from GitHub should be extracted or not. That is to say, if this field isFalse
, then the downloaded.zip
file itself is what will be synced with S3. If this is set toTrue
, then the.zip
is extracted and the extracted files is what will be compared with S3. This being set toFalse
is useful if you wanted to have the entire repository itself be the artifact that you want stored in S3 for downstream processing. For the use case of syncing payload templates to the templates S3 bucket, you want this to be set toTrue
so that each template is individually synced with S3.
Here are the optional fields:
IncludeRepoPaths
- List of Regex Strings - This is a list of regex strings indicate the paths on the local disk that should be synced with S3. By default, this value is set to:["^.+$"]
, which will match on everything. As mentioned on the previous page, if you wanted to sync the templates repository with S3, then for the testing deployment, you could have this set to- "^testing\/.+$"
, which would only sync repository files that exist in thetesting\
path.ExcludeRepoPaths
- List of Regex Strings - This is a list of regex strings that indicate the paths on the local disk that should not be synced with S3. This takes precedence over theIncludeRepoPaths
. In the included example above, we are ignoring specific files that we don't want synced with S3, like the.gitignore
file. By default, this field is an empty list:[]
.KeyPrefix
- This is the starting prefix in the S3 bucket that should be assessed. By default, the root of the S3 bucket is what the worker examines. If you wanted to only sync files that reside within thefoo/
prefix of the bucket, then you would want to set this value tofoo/
. All repo files would then be set to reside infoo/filename...
on the bucket.DeleteMissingFiles
- Boolean - By default, this is set toFalse
. If this is set toTrue
, then the worker will delete any object in the S3 bucket that is not found in the GitHub repository. This flag being enabled keeps the S3 bucket contents 1:1 in sync with the repository.