-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f3d01fa
Showing
5 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
telophase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM golang:1.21 | ||
LABEL maintainer="Danny Schofield, [email protected]" | ||
|
||
# copy from repo into container image: | ||
COPY entrypoint.sh /entrypoint.sh | ||
COPY telophasecli /telophase | ||
|
||
# make default on start-up: | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Telophase CLI Github Action | ||
This action allows for you to manage your AWS accounts and organization with telophase. | ||
|
||
|
||
## Example Usage | ||
In a GH Action file, for example, `.github/workflows/main.yaml`: | ||
|
||
``` | ||
on: [push] | ||
jobs: | ||
create_cluster: | ||
runs-on: ubuntu-latest | ||
name: Manage AWS accounts and organization with telophase | ||
steps: | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
# Use the credentials for the Management Account | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
- name: Plan | ||
uses: telophase-actions/[email protected] | ||
with: | ||
apply: false | ||
- name: Provision cluster | ||
uses: telophase-actions/[email protected] | ||
with: | ||
# Setting apply to true means that the GitHub action will modify your infrastructure. | ||
apply: true | ||
``` | ||
|
||
# Inputs | ||
- apply: 'If the infrastructure change should be applied' | ||
- cdk_path: 'If the infrastructure change should be applied' | ||
- account_tag: 'Tag associated with the accounts to deploy' | ||
- organization_path: 'Path to your organization.yml file' | ||
- stacks: 'Stacks to deploy if not set will deploy all stacks' | ||
|
||
# Env | ||
- `AWS_ACCESS_KEY_ID` Required | ||
- `AWS_SECRET_ACCESS_KEY` Required | ||
|
||
## License | ||
This project is licensed under the Apache-2.0 License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: 'Telophase CLI deploy' | ||
description: 'Update your infrastructure with the Telophase CLI' | ||
inputs: | ||
apply: | ||
description: 'If the infrastructure change should be applied' | ||
required: true | ||
default: false | ||
|
||
cdk_path: | ||
description: 'If the infrastructure change should be applied' | ||
required: false | ||
|
||
account_tag: | ||
description: 'Tag associated with the accounts to deploy' | ||
required: false | ||
default: "all" | ||
|
||
organization_path: | ||
description: 'Path to your organization.yml file' | ||
required: false | ||
|
||
stacks: | ||
description: 'Stacks to deploy' | ||
required: false | ||
default: "" | ||
|
||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
args: | ||
- ${{ inputs.apply }} | ||
- ${{ inputs.cdk-path }} | ||
- ${{ inputs.account-tag }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#/bin/sh | ||
|
||
set -e | ||
|
||
# go install github.com/santiago-labs/telophasecli@latest | ||
apply="" | ||
if [ $INPUT_APPLY = true ]; then | ||
apply="--appply" | ||
fi | ||
|
||
cdk_path="" | ||
if [ $INPUT_CDK_PATH ]; then | ||
cdk_path="--cdk-path=$INPUT_CDK_PATH" | ||
fi | ||
|
||
account_tag="--account-tag=$INPUT_ACCOUNT_TAG" | ||
|
||
org_file="" | ||
if [ $INPUT_ORGANIZATION_PATH ]; then | ||
org_file="--org=$INPUT_ORGANIZATION_PATH" | ||
fi | ||
|
||
stacks="--all-stacks" | ||
if [ $INPUT_STACKS ]; then | ||
stacks="--stacks=-\"$INPUT_STACKS\"" | ||
fi | ||
|
||
./telophase deploy $apply $cdk_path $account_tag $org_file $stacks |