README.md 1.69 KB
Newer Older
Spencer Williams's avatar
Spencer Williams committed
1
2
3
4
5
Cascade Hello World (Node.js) Frontend Application
====

See the tutorial: https://deviceops.rigado.com/projects/cascade/en/latest/prototyping/custom-cloud.html

Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
6
### Deploy to AWS
Spencer Williams's avatar
Spencer Williams committed
7
1. [Configure](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html) AWS CLI SDK.
Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
8
2. Install [NodeJs >= 8](https://nodejs.org/en/) and [Yarn >= 1](https://yarnpkg.com/en/docs/install)
Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
9
3. Run in console.
Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
10
11

```bash
Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
12
13
14
yarn install
yarn run deploy --key <Name of an existing EC2 KeyPair>
```
Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
15
4. Wait for CloudFormation Stack creation.
Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
16

Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
17
18
```bash
yarn run publish
Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
19
```
Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
20
To see deploy information execute.
Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
21

Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
22
23
24
```bash
yarn run describe-stacks
```
Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
25
26

### Run in develop mode
Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
27
Run in console.
Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
28
```bash
Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
29
30
31
32
33
yarn run install
yarn run start
```

### Command API
Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
34
35
36
37
`yarn run deploy`
Creates AWS CloudFormation Stack.

Options
Spencer Williams's avatar
Spencer Williams committed
38
- *stackName* - AWS CloudFormation Stack Name default rigado-node-hello-world-frontend
Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
39
40
41
42
43
44
45
- *region* - AWS region **default** *us-east-1*
- *key* - Name of an existing EC2 KeyPair to enable SSH access to the instances **required**
- *instanceType* - EC2 Instance Type **default** *t2.micro*

`yarn run publish`
Sync Web to s3.
Options
Spencer Williams's avatar
Spencer Williams committed
46
- *stackName* - AWS CloudFormation Stack Name default rigado-node-hello-world-frontend
47
- *updateEnv* - Updates .env file by stack data **default** *true*
Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
48
49
50

`yarn describe-stacks`
Returns the stack description.
Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
51

Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
52
Options
Spencer Williams's avatar
Spencer Williams committed
53
- *stackName* - AWS CloudFormation Stack Name **default** *rigado-node-hello-world-frontend*
Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
54
- *region* - AWS region **default** *us-east-1*
Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
55

Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
56
57
`yarn delete`
Deletes stack. Once the call completes successfully, stack deletion starts.
Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
58

Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
59
Options
Spencer Williams's avatar
Spencer Williams committed
60
61
- *stackName* - AWS CloudFormation Stack Name **default** *rigado-node-hello-world-frontend*
- *region* - AWS region **default** *us-east-1*