Skip to content

Commit

Permalink
feat(gcli): added global auth token using a environment variable GCLI…
Browse files Browse the repository at this point in the history
…_AUTH_TOKEN
  • Loading branch information
Stradivario committed Jan 26, 2023
1 parent 8b274de commit 6f9d3e5
Show file tree
Hide file tree
Showing 9 changed files with 586 additions and 21 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@
"@types/rimraf": "^2.0.2",
"@types/yamljs": "^0.2.30",
"@rxdi/dts-merge": "^0.0.239",
"parcel-plugin-electron-dotenv": "^0.1.0"
"parcel-plugin-electron-dotenv": "^0.1.0",
"dotenv-load": "^2.0.1",
"esbuild": "0.15.18"
},
"dependencies": {
"@rxdi/core": "^0.7.136",
Expand Down Expand Up @@ -115,4 +117,4 @@
"ts-morph": "^1.3.1",
"js-yaml": "^4.1.0"
}
}
}
8 changes: 8 additions & 0 deletions packages/gcli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,11 @@ gcli lambda:get
```bash
gcli lambda:test --queryParams '?test=1&proba=1&dada=5' --pathParams 'proba=5;test=7'
```
#### Default long lived token for CI/CD using github actions
Can be set using environment variable called `GCLI_AUTH_TOKEN`
```
export GCLI_AUTH_TOKEN='my-generated-token'
```
21 changes: 21 additions & 0 deletions packages/gcli/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const dotenvLoad = require('dotenv-load');
dotenvLoad(process.env.NODE_ENV);

require('esbuild')
.build({
entryPoints: ['./src/main.ts'],
bundle: true,
platform: 'node',
target: 'node14.4',
outfile: './release/index.js',
define: {
'process.env.MONGODB_URI': `'${process.env.MONGODB_URI}'`,
'process.env.NODE_ENV': `'${process.env.NODE_ENV}'`,
'process.env.PORT': `9000`,
},
})
.then((data) => console.log('SUCCESS', data))
.catch((e) => {
console.error(e);
process.exit(1);
});
Loading

0 comments on commit 6f9d3e5

Please sign in to comment.