This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createUrl, Paths } from './get-env-vars' | |
describe("GetEnvVars", () => { | |
const OLD_ENV = process.env; | |
beforeEach(() => { | |
process.env = { ...OLD_ENV }; | |
delete process.env.NODE_ENV; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export enum Paths { | |
PRODUCTS = '/products' | |
} | |
export const createUrl = (path: Paths) => `${process.env.BASE_URL}${path}` | |
export const productsUrl = createUrl(Paths.PRODUCTS) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const app = await NestFactory.create(AppModule, express, { | |
bufferLogs: true, | |
abortOnError: false, // create a nest module and rethrow an error, instead of aborting the startup | |
}).catch(console.error) as INestApplication |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Module({}) | |
export class MyDynamicModule { | |
static register(config): DynamicModule { | |
const { customPath } = config; | |
const MyController = createDynamicController({ customPath }) | |
return { | |
module: MyDynamicModule, | |
providers: [ | |
MyService | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// dynamic.controller.ts | |
export const createDynamicController = ({ customPath }): Type<any> { | |
@Controller() | |
class MyController { | |
constructor(private service: MyService) { } | |
@Get([customPath]) | |
async getSomething(@Res() res: Response) { | |
//... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// cats.controller.ts | |
import { Controller, Get } from '@nestjs/common'; | |
import { CatsService } from './cats.service.ts' | |
@Controller('cats') | |
export class CatsController { | |
constructor( | |
private catsService: CatsService | |
){} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Test } from '@nestjs/testing'; | |
import { CatsController } from './cats.controller'; | |
import { CatsService } from './cats.service'; | |
describe('CatsController', () => { | |
let catsController: CatsController; | |
let catsService: CatsService; | |
beforeEach(async () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// cats.service.ts | |
import { Injectable, LoggerService } from '@nestjs/common'; | |
import { DatabaseService } from './database.service'; | |
import { findOne } from './cats.utils.ts' | |
@Injectable() | |
export class CatsService { | |
constructor( | |
private loggerService: LoggerService, | |
private dbService: DatabaseService |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Initialized empty Git repository in /builds/datails/store-and-consume-helm-charts/.git/ | |
Created fresh repository. | |
Checking out 35d9ae05 as main... | |
Skipping Git submodules setup | |
Executing "step_script" stage of the job script | |
00:02 | |
Using docker image sha256:f8bb0f201e7557131bf82e50e7dda0e47382d8fdecd20c9edb3fc9f7abb025e1 for alpine/helm:3.9.4 with digest alpine/helm@sha256:df362a6029d9d931101df528c2ba8e0d9eead16fac2100f436e13141b499d8d0 ... | |
$ echo 'Write result to stdout:::' | |
Write result to stdout::: | |
$ cd charts/consume-chart && helm dependency build && helm template --debug . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default: | |
image: | |
name: alpine/helm:3.9.4 | |
entrypoint: [""] | |
stages: | |
- publish | |
- deploy | |
publish-chart: |