Allow APP_VERSION to be empty string + dockerFile fix (#10900)
# Introduction No choice but to allow APP_VERSION to be an empty string as it's though to dynamically define dockerfile env vars
This commit is contained in:
@ -0,0 +1,7 @@
|
||||
import { ValidateIf, ValidationOptions, isDefined } from 'class-validator';
|
||||
|
||||
export function IsOptionalOrEmptyString(validationOptions?: ValidationOptions) {
|
||||
return ValidateIf((_obj, value) => {
|
||||
return isDefined(value) && value !== '';
|
||||
}, validationOptions);
|
||||
}
|
||||
@ -28,6 +28,7 @@ import { CastToPositiveNumber } from 'src/engine/core-modules/environment/decora
|
||||
import { EnvironmentVariablesMetadata } from 'src/engine/core-modules/environment/decorators/environment-variables-metadata.decorator';
|
||||
import { IsAWSRegion } from 'src/engine/core-modules/environment/decorators/is-aws-region.decorator';
|
||||
import { IsDuration } from 'src/engine/core-modules/environment/decorators/is-duration.decorator';
|
||||
import { IsOptionalOrEmptyString } from 'src/engine/core-modules/environment/decorators/is-optional-or-empty-string.decorator';
|
||||
import { IsStrictlyLowerThan } from 'src/engine/core-modules/environment/decorators/is-strictly-lower-than.decorator';
|
||||
import { EnvironmentVariablesGroup } from 'src/engine/core-modules/environment/enums/environment-variables-group.enum';
|
||||
import { ExceptionHandlerDriver } from 'src/engine/core-modules/exception-handler/interfaces';
|
||||
@ -984,7 +985,7 @@ export class EnvironmentVariables {
|
||||
group: EnvironmentVariablesGroup.ServerConfig,
|
||||
description: 'Twenty server version',
|
||||
})
|
||||
@IsOptional()
|
||||
@IsOptionalOrEmptyString()
|
||||
@IsSemVer()
|
||||
APP_VERSION?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user