Giter Site home page Giter Site logo

qubitpi / react-app-release-definition-template Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 12 KB

๐Ÿšš Screwdriver CD template for deploying immutable React APP to AWS through HashiCorp

License: Apache License 2.0

aws-ami aws-ec2 ci-cd continuous-delivery continuous-deployment hashicorp hashicorp-packer hashicorp-terraform immutable-infrastructure infrastructure-as-code

react-app-release-definition-template's Introduction

React App Release Definition Template

Screwdriver CD badge HashiCorp Packer badge HashiCorp Terraform badge Apache License badge GitHub Workflow Status

A Screwdriver CD template that deploys an immutable instance of React-based frontend App to AWS. It uses the screwdriver-template-main npm package to assist with template validation, publishing, and tagging. This template tags the latest versions with the latest tag.

Tip

React App release definition template is a satellite project of hashicorp-aws and more documentation can be found in its dedicated page for React App deployment support

How to Use This Template

Note

Before preceding, please note that it is assumed React App release definition template has already been installed in Screwdriver CD.

If not, please see documentation on publishing a template in Screwdriver

Create a Screwdriver pipeline that uses this template. Here is an example:

---
jobs:
  main:
    requires: [~pr, ~commit]
    template: QubitPi/react-app-release-definition-template@latest
    secrets:
      - AWS_REACT_PKRVARS_HCL
      - SSL_CERTIFICATE
      - SSL_CERTIFICATE_KEY
      - NGINX_CONFIG_FILE
      - AWS_REACT_TFVARS
      - DOT_ENV_FILE
      - AWS_ACCESS_KEY_ID
      - AWS_SECRET_ACCESS_KEY

The following Screwdriver Secrets needs to be defined before running this template:

  • AWS_ACCESS_KEY_ID

  • AWS_SECRET_ACCESS_KEY

  • SSL_CERTIFICATE

  • SSL_CERTIFICATE_KEY

  • NGINX_CONFIG_FILE

  • AWS_REACT_PKRVARS_HCL - A HashiCorp Packer variable values file with the following variable values:

    aws_image_region                 = "us-east-2"
    ami_name                         = "my-react-app-ami"
    instance_type                    = "t2.small"
    aws_react_ssl_cert_file_path     = "ssl.crt"
    aws_react_ssl_cert_key_file_path = "ssl.key"
    aws_react_nginx_config_file_path = "nginx.conf"
    react_dist_path = "dist"
    • aws_image_region is the image region of AWS AMI
    • ami_name is the published AMI name; it can be arbitrary
    • instance_type is the recommended AWS EC2 instance type running this image
    • Please keep the values of react_dist_path, aws_react_ssl_cert_file_path, aws_react_ssl_cert_key_file_path, and aws_react_nginx_config_file_path as they are. They are used by template so that SSL configs are picked up from the right locations
  • AWS_REACT_TFVARS - A HashiCorp Terraform variable values file with the following variable values:

    aws_deploy_region   = "us-east-2"
    ami_name            = "my-react-app-ami"
    instance_type       = "t2.small"
    ec2_instance_name   = "My React App"
    ec2_security_groups = ["My React App Security Group"]
    route_53_zone_id    = "MBS8YLKZML18VV2E8M8OK"
    react_domain        = "myapp.mycompany.com"
    • aws_deploy_region is the EC2 runtime region
    • ami_name is the name of the published AMI; it must be the same as the ami_name in AWS_REACT_PKRVARS_HCL
    • instance_type is the chosen AWS EC2 instance type at runtime
    • ec2_instance_name is the deployed EC2 name as appeared in the instance list of AWS console; it can be arbitrary
    • ec2_security_groups is the AWS Security Group name (yes, not ID, but name...)
    • react_domain is the SSL-enabled domain that will serve the React App
    • route_53_zone_id is the AWS Route 53 hosted Zone ID that hosts the domain myapp.mycompany.com

Tip

To find the zone ID in AWS Route 53, we can:

  1. Sign in to the AWS Management Console
  2. Open the Route 53 console at https://console.aws.amazon.com/route53/
  3. Select Hosted zones in the navigation pane
  4. Find the requested ID in the top level Hosted Zones summary in the Route 53 section

License

The use and distribution terms for React App release definition template are covered by the Apache License, Version 2.0.

react-app-release-definition-template's People

Contributors

qubitpi avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.