From 108768b1932a9204df0d1cf1f1e1c7e4d55781b3 Mon Sep 17 00:00:00 2001 From: Mick McGrath Date: Thu, 11 May 2023 18:03:44 +0200 Subject: [PATCH 1/6] add eks using commons --- action.yaml | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index ae2e80e..aa85415 100644 --- a/action.yaml +++ b/action.yaml @@ -90,6 +90,12 @@ inputs: description: 'Set this to true if you want not to use a certificate in the ELB.' required: false + # Deployment Mode: EKS + deploy_mode: + description: "The name of the deployment environment" + required: false + default: single-vm + outputs: vm_url: description: 'The URL of the generated app' @@ -102,9 +108,54 @@ runs: if: ${{ inputs.checkout == 'true' }} uses: actions/checkout@v3 - - name: Deploy with BitOps + - name: Deploy EKS with BitOps + id: deploy + uses: bitovi/github-actions-commons@main + if: ${{ inputs.deploy_mode == 'eks' }} + with: + # Current repo vars + gh_action_repo: ${{ github.action_path }} + gh_action_input_ansible: operations/deployment/ansible + + # Action main inputs + bitops_extra_env_vars: -e ST2_AUTH_USERNAME=${{ inputs.st2_auth_username }} -e ST2_AUTH_PASSWORD=${{ inputs.st2_auth_password }} + bitops_extra_env_vars_file: extra_env + checkout: ${{ inputs.checkout }} + tf_stack_destroy: ${{ inputs.tf_stack_destroy }} + tf_state_bucket: ${{ inputs.tf_state_bucket }} + tf_state_bucket_destroy: ${{ inputs.tf_state_bucket_destroy }} + tf_state_bucket_provider: 'aws' + ansible_skip : ${{ inputs.infrastructure_only }} + + # AWS - ALL CHECK + aws_access_key_id: ${{ inputs.aws_access_key_id }} + aws_secret_access_key: ${{ inputs.aws_secret_access_key }} + aws_session_token: ${{ inputs.aws_session_token }} + aws_default_region: ${{ inputs.aws_default_region }} + aws_resource_identifier: ${{ inputs.aws_resource_identifier }} + aws_additional_tags: ${{ inputs.aws_extra_tags }} + gh_deployment_action_input_ansible_extra_vars_file: ${{ inputs.st2_ansible_extra_vars_file }} + + # AWS Route53 Domains abd Certificates + aws_r53_enable: true + aws_r53_domain_name: ${{ inputs.aws_domain_name }} + aws_r53_sub_domain_name: ${{ inputs.aws_sub_domain }} + aws_r53_root_domain_deploy: ${{ inputs.aws_root_domain }} + aws_r53_enable_cert: ${{ steps.set-cert.outputs.enable_cert }} + aws_r53_cert_arn: ${{ inputs.aws_cert_arn }} + aws_r53_create_root_cert: ${{ inputs.aws_create_root_cert }} + aws_r53_create_sub_cert: ${{ inputs.aws_create_sub_cert }} + + # AWS ELB + aws_elb_create: true + aws_elb_app_port: "443" + aws_elb_app_protocol: ssl + aws_elb_healthcheck: "HTTPS:443/" + + - name: Deploy single-vm with BitOps id: deploy shell: bash + if: ${{ inputs.deploy_mode == 'single-vm' }} env: GITHUB_ACTION_PATH: ${{ github.action_path }} BITOPS_ENVIRONMENT: deployment From 14c28a72aa356abaec7444f0594ff409e7fc8652 Mon Sep 17 00:00:00 2001 From: Mick McGrath Date: Thu, 11 May 2023 18:37:03 +0200 Subject: [PATCH 2/6] connect to commons and input eks var --- action.yaml | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/action.yaml b/action.yaml index aa85415..4310b49 100644 --- a/action.yaml +++ b/action.yaml @@ -95,6 +95,9 @@ inputs: description: "The name of the deployment environment" required: false default: single-vm + aws_eks_foo: + description: example input param to TF + default: gha-repo outputs: vm_url: @@ -110,7 +113,7 @@ runs: - name: Deploy EKS with BitOps id: deploy - uses: bitovi/github-actions-commons@main + uses: bitovi/github-actions-commons@eks if: ${{ inputs.deploy_mode == 'eks' }} with: # Current repo vars @@ -136,21 +139,25 @@ runs: aws_additional_tags: ${{ inputs.aws_extra_tags }} gh_deployment_action_input_ansible_extra_vars_file: ${{ inputs.st2_ansible_extra_vars_file }} - # AWS Route53 Domains abd Certificates - aws_r53_enable: true - aws_r53_domain_name: ${{ inputs.aws_domain_name }} - aws_r53_sub_domain_name: ${{ inputs.aws_sub_domain }} - aws_r53_root_domain_deploy: ${{ inputs.aws_root_domain }} - aws_r53_enable_cert: ${{ steps.set-cert.outputs.enable_cert }} - aws_r53_cert_arn: ${{ inputs.aws_cert_arn }} - aws_r53_create_root_cert: ${{ inputs.aws_create_root_cert }} - aws_r53_create_sub_cert: ${{ inputs.aws_create_sub_cert }} - - # AWS ELB - aws_elb_create: true - aws_elb_app_port: "443" - aws_elb_app_protocol: ssl - aws_elb_healthcheck: "HTTPS:443/" + # # AWS Route53 Domains abd Certificates + # aws_r53_enable: true + # aws_r53_domain_name: ${{ inputs.aws_domain_name }} + # aws_r53_sub_domain_name: ${{ inputs.aws_sub_domain }} + # aws_r53_root_domain_deploy: ${{ inputs.aws_root_domain }} + # aws_r53_enable_cert: ${{ steps.set-cert.outputs.enable_cert }} + # aws_r53_cert_arn: ${{ inputs.aws_cert_arn }} + # aws_r53_create_root_cert: ${{ inputs.aws_create_root_cert }} + # aws_r53_create_sub_cert: ${{ inputs.aws_create_sub_cert }} + + # # AWS ELB + # aws_elb_create: true + # aws_elb_app_port: "443" + # aws_elb_app_protocol: ssl + # aws_elb_healthcheck: "HTTPS:443/" + + + # AWS EKS + aws_eks_foo: ${{ inputs.aws_eks_foo }} - name: Deploy single-vm with BitOps id: deploy From cad867b12ad0e719059530015f5fa0fac5af45f1 Mon Sep 17 00:00:00 2001 From: Mick McGrath Date: Thu, 11 May 2023 18:41:36 +0200 Subject: [PATCH 3/6] use separate ids for steps --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index 4310b49..5ddbe2d 100644 --- a/action.yaml +++ b/action.yaml @@ -112,7 +112,7 @@ runs: uses: actions/checkout@v3 - name: Deploy EKS with BitOps - id: deploy + id: deploy-eks uses: bitovi/github-actions-commons@eks if: ${{ inputs.deploy_mode == 'eks' }} with: From 4970d5a87b5e84c7eca14be88b6144f147f4e0ec Mon Sep 17 00:00:00 2001 From: Mick McGrath Date: Thu, 11 May 2023 18:47:10 +0200 Subject: [PATCH 4/6] do not need extra_env for now --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index 5ddbe2d..2b52173 100644 --- a/action.yaml +++ b/action.yaml @@ -122,7 +122,7 @@ runs: # Action main inputs bitops_extra_env_vars: -e ST2_AUTH_USERNAME=${{ inputs.st2_auth_username }} -e ST2_AUTH_PASSWORD=${{ inputs.st2_auth_password }} - bitops_extra_env_vars_file: extra_env + # bitops_extra_env_vars_file: extra_env checkout: ${{ inputs.checkout }} tf_stack_destroy: ${{ inputs.tf_stack_destroy }} tf_state_bucket: ${{ inputs.tf_state_bucket }} From 4e5c67f93ad0958310fcf20143d08464c91b724c Mon Sep 17 00:00:00 2001 From: Mick McGrath Date: Thu, 11 May 2023 18:59:09 +0200 Subject: [PATCH 5/6] remove ansible refs --- action.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/action.yaml b/action.yaml index 2b52173..66c4e00 100644 --- a/action.yaml +++ b/action.yaml @@ -118,7 +118,6 @@ runs: with: # Current repo vars gh_action_repo: ${{ github.action_path }} - gh_action_input_ansible: operations/deployment/ansible # Action main inputs bitops_extra_env_vars: -e ST2_AUTH_USERNAME=${{ inputs.st2_auth_username }} -e ST2_AUTH_PASSWORD=${{ inputs.st2_auth_password }} @@ -128,7 +127,9 @@ runs: tf_state_bucket: ${{ inputs.tf_state_bucket }} tf_state_bucket_destroy: ${{ inputs.tf_state_bucket_destroy }} tf_state_bucket_provider: 'aws' - ansible_skip : ${{ inputs.infrastructure_only }} + + # TODO + # helm_skip : ${{ inputs.infrastructure_only }} # AWS - ALL CHECK aws_access_key_id: ${{ inputs.aws_access_key_id }} @@ -137,7 +138,6 @@ runs: aws_default_region: ${{ inputs.aws_default_region }} aws_resource_identifier: ${{ inputs.aws_resource_identifier }} aws_additional_tags: ${{ inputs.aws_extra_tags }} - gh_deployment_action_input_ansible_extra_vars_file: ${{ inputs.st2_ansible_extra_vars_file }} # # AWS Route53 Domains abd Certificates # aws_r53_enable: true From 9605ebbdd38e1a35309108cbb3162fd46553559c Mon Sep 17 00:00:00 2001 From: margani007 <47572696+margani007@users.noreply.github.com> Date: Fri, 12 May 2023 15:32:22 -0400 Subject: [PATCH 6/6] Update action.yaml --- action.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yaml b/action.yaml index 66c4e00..d5cfe8a 100644 --- a/action.yaml +++ b/action.yaml @@ -158,6 +158,7 @@ runs: # AWS EKS aws_eks_foo: ${{ inputs.aws_eks_foo }} + aws_eks_create: true - name: Deploy single-vm with BitOps id: deploy