Installation
npm
Withnpm install --save-dev sheets2env
yarn
Withyarn add -D sheets2env
Setup & Usage
CLI
$ sheets2env
CI
$ sheets2env
-p config_path
-c base64_google_credentials
-t base64_authorized_token
Script
const client = await client
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
develop
as {column:1}
and uat
as {column:2}
and production
as {column:3}
From this table we decalre column key | develop | uat | production |
---|---|---|---|
PROJECT_ID | example | example | example |
SECRET_KEY | example | example | example |
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"