0.4.88 • Published 2 years ago

cloud-factory v0.4.88

Weekly downloads
-
License
BSD-2-Clause
Repository
github
Last release
2 years ago

cloud-factory - Construct Utilities

A CLI Utility to Manage Software-Defined State

cloud-factory is a commandline application that provides ci-cd capabilities, code extensions, and overall utilities for cloud-related management and development.

In order to begin, open a node.js capable console and then run the following command:

  • npx --yes cloud-factory@latest --help

Schemas

Usage

There exists a few different ways to run cloud-factory, depending on the context.

Development Usage

While locally developing, the application can be started via the start command located in package.json:

# Start
npm run start

# Help
npm run start -- --help

# Environment Sub-Command Example
npm run start -- environment

Note: a -- is required between the run-script command, and CLI input. This is due to limitations around npm, and parsing input.

NPX Global Usage

npx runs against the most recently-published NPM package.

# Start
npx --yes cloud-factory@latest

# Help
npx --yes cloud-factory@latest ? [--] --help

# Environment Sub-Command Example
npx --yes cloud-factory@latest ? [--] environment

Note: the --yes flag is only required to bypass the install prompt. Once installed, the --yes flag can be optionally included without prompt.

NPM System Usage

cloud-factory can optionally be installed globally to any npm-capable system.

First, run npm install --global cloud-factory. Then, cloud-factory can be used similar to any other installed executable:

# Installation
npm install --global cloud-factory@latest
# Start
cloud-factory

# Help
cloud-factory --help

# Environment Sub-Command Example
cloud-factory environment

Example(s) - A Lambda Deployment

The following example deploys a single Lambda function, but includes, implicitly, the following resources:

  • Lambda Function
  • A Lambda Layer
  • API Gateway
  • X-Ray Enablement
  • Log-Groups
  • SSM Parameter(s)

Note, the only requirement would be a Lambda Function, but for the sake of demonstration, the example includes a Lambda Layer, too.

All other resources are defined dynamically by cloud-factory.

  1. Define and create a new directory
    • mkdir -p example
    • cd example
  2. Clone source(s)
    1. Lambda Function
      • git clone https://github.com/cloud-hybrid/lambda-function-concept.git ./test-function
    2. Lambda Layer
      • git clone https://github.com/cloud-hybrid/lambda-layer-concept.git ./library/test-layer
  3. Define a factory.json file:
    {
        "name": "Concept",
        "organization": "Cloud-Vault",
        "environment": "Development"
    }
    • i.e.
    cat << "EOF" > factory.json
    {
        "name": "Concept",
        "organization": "Cloud-Vault",
        "environment": "Development"
    }
    EOF
  4. Ensure the current directory takes the following shape:
    example
      ├── factory.json
      ├── test-function
      └── library
          └── test-layer
  5. With the current-working-directory set to example, run:
    npx --yes cloud-factory@latest ci-cd initialize --debug
    • Feel free to omit the --debug flag. It's only included for verbosity and understanding
  6. Verify that a distribution folder was created.
  7. Synthesize the state + source code:
    npx --yes cloud-factory@latest ci-cd synthesize --debug
  8. Deploy the lambda function + layer:
    npx --yes cloud-factory@latest ci-cd deploy --debug
  9. A hyperlink will be provided upon successful completion. With reference to the example, navigating to https://v41dkt0ik0.execute-api.us-east-2.amazonaws.com/development/test-function will then provide a JSON response body containing information about the package, and the lambda function's layer.

Synopsis

mkdir -p example && cd "${_}"

git clone https://github.com/cloud-hybrid/lambda-function-concept.git ./test-function

git clone https://github.com/cloud-hybrid/lambda-layer-concept.git ./library/test-layer

cat << "EOF" > factory.json
{
    "name": "Concept",
    "organization": "Cloud-Vault",
    "environment": "Development"
}
EOF

npx --yes cloud-factory@latest --version

npx cloud-factory ci-cd initialize  --debug
npx cloud-factory ci-cd synthesize  --debug
npx cloud-factory ci-cd deploy      --debug

[[ "${?}" == "0" ]] && echo "Successfully Deployed"
0.4.88

2 years ago

0.4.87

2 years ago

0.4.86

2 years ago

0.4.85

2 years ago

0.4.84

2 years ago

0.4.83

2 years ago

0.4.82

2 years ago

0.4.81

2 years ago

0.4.79

2 years ago

0.4.78

2 years ago

0.4.77

2 years ago

0.4.76

2 years ago

0.4.74

2 years ago

0.4.73

2 years ago

0.4.72

2 years ago

0.4.71

2 years ago

0.4.69

2 years ago

0.4.67

2 years ago

0.4.66

2 years ago

0.4.65

2 years ago

0.4.64

2 years ago

0.4.63

2 years ago

0.4.61

2 years ago

0.4.60

2 years ago

0.4.59

2 years ago

0.3.58

2 years ago

0.3.57

2 years ago

0.3.56

2 years ago

0.3.54

2 years ago

0.3.53

2 years ago

0.3.51

2 years ago

0.3.48

2 years ago

0.3.46

2 years ago

0.3.41

2 years ago

0.3.40-rc

2 years ago

0.3.39

2 years ago

0.3.38

2 years ago

0.3.37

2 years ago

0.3.36

2 years ago

0.3.35

2 years ago

0.2.34

2 years ago

0.2.32

2 years ago

0.2.28

2 years ago

0.2.27

2 years ago

0.2.26

2 years ago

0.2.21

2 years ago

0.2.19

2 years ago

0.2.18

2 years ago

0.2.17

2 years ago

0.2.16

2 years ago

0.2.15

2 years ago

0.2.14

2 years ago

0.2.12

2 years ago