Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • dojo_project/projects/shared/nodesharedcode
1 result
Select Git revision
Show changes
Commits on Source (3)
import * as process from 'process';
class SharedConfig {
public readonly production: boolean;
public debug: boolean = false;
......@@ -7,6 +10,7 @@ class SharedConfig {
public sonar: {
enabled: boolean
url: string
token: string
}
public gitlab: {
......@@ -28,7 +32,8 @@ class SharedConfig {
this.production = process.env.NODE_ENV === 'production';
this.sonar = {
enabled: ['yes', 'true', '1', 'on'].includes(process.env.SONAR_ENABLED?.trim()?.toLowerCase() ?? ''),
url: process.env.SONAR_URL || ''
url: process.env.SONAR_URL || '',
token: process.env.SONAR_TOKEN || ''
};
this.logsFolder = process.env.LOGS_FOLDER || '';
......
import axios from 'axios';
import https from 'https';
import SharedConfig from '../config/SharedConfig';
class SharedSonarManager {
// Use custom instance to allow self-signed certificates
private instance = axios.create({
httpsAgent: new https.Agent({
rejectUnauthorized: false
})
});
async isSonarSupported(): Promise<boolean> {
if (!SharedConfig.sonar.enabled) {
return false;
}
try {
const sonar = await this.instance.get(SharedConfig.sonar.url);
return sonar.status == 200;
} catch ( error ) {
return false;
}
}
}
export default new SharedSonarManager();
\ No newline at end of file
......@@ -11,6 +11,8 @@ enum ExerciseCheckerError {
COMPOSE_FILE_VOLUME_MISSING = 209,
DOCKERFILE_NOT_FOUND = 210,
COMPOSE_RUN_SUCCESSFULLY = 211, // Yes, this is an error
ASSIGNMENT_MISSING = 212,
BUILD_LINE_MISSING = 213,
}
......
......@@ -5,6 +5,7 @@ import { z } from 'zod';
const AssignmentFile = z.object({
dojoAssignmentVersion: z.number(),
version : z.number(),
buildLine : z.string().optional(),
immutable : z.array(ImmutableFileDescriptor.transform(value => value as ImmutableFileDescriptor)),
result : z.object({
container: z.string(),
......
interface SonarProjectCreation {
project: {
key: string,
name: string,
qualifier: string,
visibility: string
}
}
export default SonarProjectCreation;
\ No newline at end of file
enum SonarRoute {
SET_PAT = '/api/alm_integrations/set_pat',
PROJECT_CREATE_GITLAB = '/api/alm_integrations/import_gitlab_project'
}
export default SonarRoute;
\ No newline at end of file