Skip to content
Draft
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This repository contains the source code for Heimdall's [Backend](https://github
- [Heimdall with Backend (Server)](#heimdall-with-backend-server)
- [Features](#features)
- [Use Cases](#use-cases)
- [Heimdall Server - Project Mode]
- [Getting Started / Installation](#getting-started--installation)
- [Heimdall Lite](#heimdall-lite-1)
- [Running via npm](#running-via-npm)
Expand Down
30 changes: 30 additions & 0 deletions apps/backend/config/app_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ import * as dotenv from 'dotenv';
import * as fs from 'fs';
import { Dialect } from 'sequelize/types';

export interface AuthArtiAuthCreds {
accessKeyId: string | undefined;
secretAccessKey: string | undefined;
sessionToken: string | undefined;
}

export default class AppConfig {
private envConfig: { [key: string]: string | undefined };

Expand Down Expand Up @@ -166,4 +172,28 @@ export default class AppConfig {
return true;
}
}

getAuthArtiS3URL() {
return this.get("S3_URL") || '';
}
getAuthArtiS3AccessKey() {
return this.get("S3_ACCESS_KEY") || '';
}

getAuthArtiS3Secret() {
return this.get("S3_SECRET_KEY") || '';
}

getAuthArtiS3BucketName() {
return this.get("S3_BUCKET_NAME") || '';
}

getAuthArtiS3AuthCreds() {
let s3AuthCreds: AuthArtiAuthCreds = {
accessKeyId: this.get("S3_ACCESS_KEY"),
secretAccessKey: this.get("S3_SECRET_KEY"),
sessionToken: ""
}
return s3AuthCreds;
}
}
56 changes: 56 additions & 0 deletions apps/backend/migrations/20230206121829-create-pipelines_table.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
'use strict';

module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('Pipelines', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.BIGINT
},
buildId: {
type: Sequelize.STRING,
allowNull: false
},
buildType: {
type: Sequelize.INTEGER,
allowNull: true
},
branchName: {
type: Sequelize.STRING,
allowNull: true
},
groupId: {
type: Sequelize.BIGINT,
references: {
model: 'Groups',
key: 'id'
},
onUpdate: 'CASCADE',
onDelete: 'SET NULL'
},
userId: {
type: Sequelize.BIGINT,
references: {
model: 'Users',
key: 'id'
},
onUpdate: 'CASCADE',
onDelete: 'SET NULL'
},
createdAt: {
type: Sequelize.DATE,
allowNull: false
},
updatedAt: {
type: Sequelize.DATE,
allowNull: false
}
})
},

down: (queryInterface, Sequelize) => {
return queryInterface.dropTable('Pipelines');
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
'use strict';

module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('PipelineEvaluations', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.BIGINT
},
pipelineId: {
type: Sequelize.BIGINT,
references: {
model: 'Pipelines',
key: 'id'
},
onUpdate: 'CASCADE',
onDelete: 'SET NULL'
},
evaluationId: {
type: Sequelize.BIGINT,
references: {
model: 'Evaluations',
key: 'id'
},
onUpdate: 'CASCADE',
onDelete: 'SET NULL'
},
createdAt: {
type: Sequelize.DATE,
allowNull: false
},
updatedAt: {
type: Sequelize.DATE,
allowNull: false
}
})
},

down: (queryInterface, Sequelize) => {
return queryInterface.dropTable('PipelineEvaluations');
}
};
60 changes: 60 additions & 0 deletions apps/backend/migrations/20230305141122-create-products_table.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
'use strict';

module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('Products', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.BIGINT
},
productName: {
type: Sequelize.STRING,
allowNull: false
},
productId: {
type: Sequelize.BIGINT,
allowNull: false
},
productURL: {
type: Sequelize.STRING,
allowNull: true
},
objectStoreKey: {
type: Sequelize.STRING,
allowNull: true
},
groupId: {
type: Sequelize.BIGINT,
references: {
model: 'Groups',
key: 'id'
},
onUpdate: 'CASCADE',
onDelete: 'SET NULL'
},
userId: {
type: Sequelize.BIGINT,
references: {
model: 'Users',
key: 'id'
},
onUpdate: 'CASCADE',
onDelete: 'SET NULL'
},
createdAt: {
type: Sequelize.DATE,
allowNull: false
},
updatedAt: {
type: Sequelize.DATE,
allowNull: false
}
})
},

down: (queryInterface, Sequelize) => {
return queryInterface.dropTable('Products');
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
'use strict';

module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('ProductPipelines', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.BIGINT
},
pipelineId: {
type: Sequelize.BIGINT,
references: {
model: 'Pipelines',
key: 'id'
},
onUpdate: 'CASCADE',
onDelete: 'SET NULL'
},
productId: {
type: Sequelize.BIGINT,
references: {
model: 'Products',
key: 'id'
},
onUpdate: 'CASCADE',
onDelete: 'SET NULL'
},
createdAt: {
type: Sequelize.DATE,
allowNull: false
},
updatedAt: {
type: Sequelize.DATE,
allowNull: false
}
})
},

down: (queryInterface, Sequelize) => {
return queryInterface.dropTable('ProductPipelines');
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
'use strict';

module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('GroupProducts', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.BIGINT
},
groupId: {
type: Sequelize.BIGINT,
references: {
model: 'Groups',
key: 'id'
},
onUpdate: 'CASCADE',
onDelete: 'SET NULL'
},
productId: {
type: Sequelize.BIGINT,
references: {
model: 'Products',
key: 'id'
},
onUpdate: 'CASCADE',
onDelete: 'SET NULL'
},
createdAt: {
type: Sequelize.DATE,
allowNull: false
},
updatedAt: {
type: Sequelize.DATE,
allowNull: false
}
})
},

down: (queryInterface, Sequelize) => {
return queryInterface.dropTable('GroupProducts');
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
'use strict';

module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('GroupPipelines', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.BIGINT
},
groupId: {
type: Sequelize.BIGINT,
references: {
model: 'Groups',
key: 'id'
},
onUpdate: 'CASCADE',
onDelete: 'SET NULL'
},
pipelineId: {
type: Sequelize.BIGINT,
references: {
model: 'Pipelines',
key: 'id'
},
onUpdate: 'CASCADE',
onDelete: 'SET NULL'
},
createdAt: {
type: Sequelize.DATE,
allowNull: false
},
updatedAt: {
type: Sequelize.DATE,
allowNull: false
}
})
},

down: (queryInterface, Sequelize) => {
return queryInterface.dropTable('GroupPipelines');
}
};
Loading