Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "serverless-doppler",
"version": "1.0.2",
"repository": "https://github.com/danieluhm2004/serverless-doppler.git",
"author": "danieluhm2004 <iam@dan.al>",
"version": "1.0.3",
"repository": "https://github.com/ProjectFrank/serverless-doppler.git",
"author": "ProjectFrank <ProjectFrank@users.noreply.github.com>",
"description": "It makes it easier to use Doppler without setup in serverless.",
"main": "src/index.js",
"license": "MIT",
Expand Down
3 changes: 1 addition & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,10 @@ class ServerlessDoppler {
apiHost: 'https://api.doppler.com',
includeDynamicSecrets: true,
};

const propertyByCli = this.getDopplerPropertyByCli();
const propertyByServerless = this.getDopplerPropertyByServerless();
_.merge(property, propertyByCli, propertyByServerless);
if (this.stage) _.set(property, 'config', this.stage);
if (this.stage && !propertyByServerless.config) _.set(property, 'config', this.stage);
this.serverless.cli.log(
`Loaded Doppler settings. (project: ${property.project}, config: ${property.config})`
);
Expand Down
13 changes: 13 additions & 0 deletions src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,19 @@ describe('Check serverless-doppler plugin', () => {
});
});

test('Get doppler property', () => {
const customConfig = {
apiHost: `${randomBytes(4).toString('hex')}`,
config: `${randomBytes(4).toString('hex')}`,
token: `${randomBytes(4).toString('hex')}`,
project: `${randomBytes(4).toString('hex')}`,
includeDynamicSecrets: true,
};
plugin.stage = 'mystage';
plugin.serverless.service.custom.doppler = customConfig;
expect(plugin.getDopplerProperty()).toEqual(customConfig);
});

test('Get doppler property by Serverless (Empty)', () => {
expect(plugin.getDopplerPropertyByServerless()).toEqual({
apiHost: undefined,
Expand Down