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 47bb978
Show file tree
Hide file tree
Showing 7 changed files with 416 additions and 19 deletions.
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 47bb978

Please sign in to comment.