Skip to content

Commit

Permalink
Merge pull request #154 from nimblehq/release/1.4.0
Browse files Browse the repository at this point in the history
Release - 1.4.0
  • Loading branch information
hoangmirs authored Jan 10, 2023
2 parents c5b8e52 + 2c2ee8a commit d5c9e3e
Show file tree
Hide file tree
Showing 18 changed files with 286 additions and 727 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Team
# @hoangmirs is the Team Lead and the others are team members
* @hoangmirs @andyduong1920 @byhbt @hanam1ni @junan @longnd @rosle @Nihisil @bterone @Lahphim @malparty
* @hoangmirs @andyduong1920 @bterone @byhbt @hanam1ni @longnd @malparty @Nihisil @nvminhtue @rosle

# Engineering Leads
CODEOWNERS @nimblehq/engineering-leads
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

Expand All @@ -18,7 +18,7 @@ jobs:
- name: Setup node and restore cached dependencies
uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '18.x'
cache: 'npm'

- name: Install dependencies
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "16.x"
cache: "npm"
registry-url: "https://registry.npmjs.org"
scope: "@nimblehq"
node-version: '18.x'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
scope: '@nimblehq'

- name: Install dependencies
run: npm ci
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ jobs:
name: Run Tests
strategy:
matrix:
node-version: [16.x]
runs-on: ubuntu-20.04
node-version: [16.x, 18.x]
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Cache Node npm
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-infrastructure-templates-node-${{ hashFiles('**/package-lock.json') }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
oclif.manifest.json
yarn.lock
/coverage
.DS_Store
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.12.1
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 18.12.1
108 changes: 108 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Contributing guidelines for the project

First off, thank you for considering contributing to this project. It's people like you that make this project such a great tool. We appreciate your help!

The following is a set of guidelines for contributing to this project. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.

## Introduction

This project uses TypeScript and [OCLIF](https://oclif.io/) to build the CLI, Jest for testing, and ESLint for code formatting and linting.

## Issues and feature requests

If you have any issues or feature requests, please create an issue in the [GitHub issues](https://github.com/nimblehq/infrastructure-templates/issues) page.

## Development

### Prerequisites

- [Node.js](https://nodejs.org/en/download/) 12.x or higher - 18.x LTS is recommended
- NPM is preferred to use with this project

### Install dependencies

```bash
npm install
```

### Run the CLI locally

Run the following command and follow the instructions:

```bash
bin/dev generate {project-name}
```

### Project structure

The project has the following main folders:

- `bin` - contains the executable file for the CLI
- `dev` - the executable file for the CLI in development mode
- `run` - the executable file for the CLI in production mode

- `src` - contains the source code of the CLI
- `index.ts` - the entry point of the CLI
- `commands` - contains the commands of the CLI
- `helpers` - contains the helper functions of the CLI
- `childProcess` - contains the helper functions for child process
- `file` - contains the helper functions for file interaction
- `terraform` - contains the helper functions for Terraform
- `templates` - contains the code to generate the templates
- `addons` - contains the code to generate the common addons e.g. version control, CI/CD, etc.
- `aws` - contains the code to generate the AWS modules e.g. VPC, RDS, etc.
- `core` - contains the code to generate the main Terraform files e.g. `main.tf`, `variables.tf`, etc.
- `skeleton` - contains the skeleton files for the project
- `addons` - contains the skeleton files for common addons e.g. version control, CI/CD, etc.
- `aws` - contains the skeleton files for AWS modules
- `core` - contains the skeleton files for common files e.g. `main.tf`, `variables.tf`, `.gitignore`, etc.
- `test` - contains the test helpers and configurations

### Add a new command

To add a new command, create a new folder in the `src/commands` and add the `index.ts` file.
The command documentation can be found [here](https://oclif.io/docs/commands).

### Add a new addon/module

To add a new addon/module, you need to create a new folder in the `src/templates` folder depending on the type of the addon/module:

- For common addons, create a new folder in the `src/templates/addons` folder
- For AWS modules, create a new folder in the `src/templates/aws` folder
- For common files, create a new folder in the `src/templates/core` folder

Check the existing addons/modules for the reference.

## Testing

### Run tests

```bash
npm run test
```

### Run and fix linting

```bash
npm run lint // to check linting

npm run lint:fix // to fix linting
```

## Publishing

- This project will be published to NPM automatically when a new release is created in GitHub. Therefore, the package version in `package.json` should be updated before creating a new release.

- The release should be created in the `main` branch.

- The release should be created with the following format: `{version}` e.g. `1.0.0`

### Manual publishing

- To publish the project manually, run the following command:

```bash
npm run publish
```

**Note:** NPM credentials are required to publish the project. Ensure that the version in `package.json` is updated.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ or
npx @nimblehq/infra-template generate {project-name}
```

## Contributing

Check out our [contributing guidelines](/CONTRIBUTING.md) to get started.

## License

This project is Copyright (c) 2014 and onwards Nimble. It is free software and may be redistributed under the terms specified in the [LICENSE] file.
Expand Down
2 changes: 2 additions & 0 deletions bin/run
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env node

process.env.NODE_ENV = 'production';

const oclif = require('@oclif/core')

oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle'))
Loading

0 comments on commit d5c9e3e

Please sign in to comment.