In a new AWS account execute the following setup steps:
- Run the command:
./deploy.sh [aws-profile-name]
- In AWS Secrets Manager update the secret
/pipeline-factory/default-github-token
with a GitHub token with read access to code and packages
To manually deploy a pipeline for a given repository to an account.
- In the target AWS account in API Gateways lookup the
PipeLine-Factory
API - In API stages go to
prod
and retrieve the invoke URL - In AWS console go to API Keys and retrieve
PipeLine-Factory-access-key
key value - Execute the following REST API call with settings updated:
curl --location --request POST 'https://{API_GATEWAY_PROD_STAGE_URL}/branch-created' \
--header 'x-api-key: {API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
"event": "push",
"repository_name": "{REPOSITORY_NAME}",
"repository_owner": "{REPOSITORY_OWNER}",
"branch": "{BRANCH_NAME}",
"settings": {
"monitoredBranches": [
"{BRANCH_NAME}"
]
}
}'
To automatically bootstrap the pipelines for a repository apply the following configuration.
- Add a GitHub topic to the repository matching the pattern:
pipeline-factory-{AWS_ACCOUNT_NUMBER}
- Add a configuration file to the root of the repository called
pipeline-factory.settings
using the following template:
{
// name of s3 bucket to store build artifacts , if omitted default PLF bucket is used
"artifactsBucketName": "s3 bucket name",
// iam role to use for , if omitted default PLF BuildAsRole is used
"buildAsRoleArn": "iam role arn",
// relative location of build spec file , if omitted default is "./buildspec.yml"
"buildspecFileLocation": "./scripts/custom_buildspec.yml",
// an array of branch names that should be monitored by Pipeline Factory
// "master" branch is default value and is always monitored even if not on the list.
"monitoredBranches": ["feature-1", "bugfix-12", "test", "demo"],
"notifications": [
{
"branches": ["master", "acc", "prod"],
"event": "FAILED",
"channelType": "SLACK",
"channelId": "sphinx-team"
}
]
}