1.2.4 • Published 4 years ago

sheets2env v1.2.4

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

Installation

With npm

npm install --save-dev sheets2env

With yarn

yarn add -D sheets2env

Setup & Usage

CLI

$ sheets2env

CI

$ sheets2env 
-p config_path 
-c base64_google_credentials 
-t base64_authorized_token

Script

import { SheetsEnv } from 'sheets2env'

const client = new SheetsEnv()
await client.sync()

Example of token file

// This file is auto generated after sync()
// This file is placed to ~/.sheets2env/google-token
{
    "access_token": "...",
    "expiry_date":  1573214579858,
    "refresh_token": "...",
    "scope":        "https://www.googleapis.com/auth/spreadsheets.readonly",
    "token_type":   "Bearer",
}

Google Sheet Structure

From this table we decalre column develop as {column:1} and uat as {column:2} and production as {column:3}
keydevelopuatproduction
PROJECT_IDexampleexampleexample
SECRET_KEYexampleexampleexample

You can find this config at your_project/sheets2env.config.json

{
    "projects": [
        {
            "column": 3,
            "dest": "path/to/your/1/.env",
            "tab": "project_1"
        },
        {
            "column": 1,
            "dest": "path/to/your/2/.env.development",
            "tab": "project_2"
        },
        {
            "column": 2,
            "dest": "path/to/your/2/.env.uat",
            "tab": "project_2"
        },
        {
            "column": 3,
            "dest": "path/to/your/2/.env",
            "tab": "project_2"
        }
    ],
    "sheetId": "your_sheets_id"
}
1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago