From e84e83f0577d72e70d9e9923128f6738178dd1a1 Mon Sep 17 00:00:00 2001 From: Holash Chand Date: Mon, 16 Oct 2023 17:44:36 +0530 Subject: [PATCH] fixed docker build failures --- Dockerfile | 2 +- Makefile | 9 +++++---- .../config-workflow/config-workflow.component.ts | 4 ++-- src/app/admin/ownership/ownership.component.ts | 2 +- .../documents/add-document/add-document.component.ts | 2 +- src/app/forms/forms.component.ts | 12 ++++++------ src/app/layouts/layouts.component.ts | 4 ++-- src/app/tables/tables.component.ts | 2 +- 8 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index d16171a..8363b70 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,6 @@ COPY . /app ARG configuration=production RUN npm run build -- --outputPath=./dist/out # Stage 2, use the compiled app, ready for production with Nginx -FROM dockerhub/sunbird-rc-nginx +FROM ghcr.io/sunbird-rc/sunbird-rc-nginx COPY --from=build /app/dist/out/ /usr/share/nginx/html/admin COPY /deps/nginx.conf /etc/nginx/conf.d/default.conf diff --git a/Makefile b/Makefile index ee73f0d..bccec0c 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ RELEASE_VERSION = v0.0.7-beta +IMAGE_NAME=ghcr.io/sunbird-rc/sunbird-rc-admin-portal build: - docker build -t dockerhub/sunbird-rc-admin-portal . + docker build -t $(IMAGE_NAME) . release: build - docker tag dockerhub/sunbird-rc-admin-portal dockerhub/sunbird-rc-admin-portal:$(RELEASE_VERSION) - docker push dockerhub/sunbird-rc-admin-portal:latest - docker push dockerhub/sunbird-rc-admin-portal:$(RELEASE_VERSION) + docker tag $(IMAGE_NAME) $(IMAGE_NAME):$(RELEASE_VERSION) + docker push $(IMAGE_NAME):latest + docker push $(IMAGE_NAME):$(RELEASE_VERSION) diff --git a/src/app/admin/config-workflow/config-workflow.component.ts b/src/app/admin/config-workflow/config-workflow.component.ts index b31ba92..6839cb3 100644 --- a/src/app/admin/config-workflow/config-workflow.component.ts +++ b/src/app/admin/config-workflow/config-workflow.component.ts @@ -465,7 +465,7 @@ export class ConfigWorkflowComponent implements OnInit { s = s.replace(/\[(\w+)\]/g, '.$1'); s = s.replace(/^\./, ''); var a = s.split('.'); - for (var i = 0, n = a.length; i < n; ++i) { + for (let i = 0, n = a.length; i < n; ++i) { var k = a[i]; if (k in o) { o = o[k]; @@ -662,7 +662,7 @@ export class ConfigWorkflowComponent implements OnInit { } else { this.checks = false; - for (var i = this.modalSelectedAttributes.length - 1; i >= 0; i--) { + for (let i = this.modalSelectedAttributes.length - 1; i >= 0; i--) { if (this.modalSelectedAttributes[i] === val) { this.modalSelectedAttributes.splice(i, 1); } diff --git a/src/app/admin/ownership/ownership.component.ts b/src/app/admin/ownership/ownership.component.ts index 765157d..a1602f8 100644 --- a/src/app/admin/ownership/ownership.component.ts +++ b/src/app/admin/ownership/ownership.component.ts @@ -188,7 +188,7 @@ export class OwnershipComponent implements OnInit, OnChanges { let requiredProperties = this.useCaseSchema[i]["schema"]["definitions"][this.entityName]["required"]; if (this.useCaseSchema[i]["schema"]["definitions"][this.entityName]?.properties) { var nestedFields = this.useCaseSchema[i]["schema"]["definitions"][this.entityName].properties; - for (var c in nestedFields) { + for (let c in nestedFields) { if (nestedFields.hasOwnProperty(c)) { if (nestedFields[c].required) { for (let k = 0; k < nestedFields[c].required.length; k++) { diff --git a/src/app/documents/add-document/add-document.component.ts b/src/app/documents/add-document/add-document.component.ts index de86013..76490f5 100644 --- a/src/app/documents/add-document/add-document.component.ts +++ b/src/app/documents/add-document/add-document.component.ts @@ -209,7 +209,7 @@ export class AddDocumentComponent implements OnInit { if (this.steps_length == this.step) { this.schemaloaded = false; this.schema_property = JSON.parse(this.doc_data['additionalInput']) - for (var [key, value] of Object.entries(this.schema_property)) { + for (let [key, value] of Object.entries(this.schema_property)) { console.log(key, value); if (value["value"]) { var datavalue = this.getValue(value["value"], this.doc_data); diff --git a/src/app/forms/forms.component.ts b/src/app/forms/forms.component.ts index 1f6b238..329ead3 100644 --- a/src/app/forms/forms.component.ts +++ b/src/app/forms/forms.component.ts @@ -697,7 +697,7 @@ exLength : number = 0 this.generalService.getPrefillData(apiurl).subscribe((res) => { if (field.autofill.fields) { field.autofill.fields.forEach(element => { - for (var [key1, value1] of Object.entries(element)) { + for (let [key1, value1] of Object.entries(element)) { this.createPath(this.model, key1, this.ObjectbyString(res, value1)) this.form2.get(key1).setValue(this.ObjectbyString(res, value1)) } @@ -705,7 +705,7 @@ exLength : number = 0 } if (field.autofill.dropdowns) { field.autofill.dropdowns.forEach(element => { - for (var [key1, value1] of Object.entries(element)) { + for (let [key1, value1] of Object.entries(element)) { if (Array.isArray(res)) { res = res[0] } @@ -726,7 +726,7 @@ exLength : number = 0 if (field.autofill.fields) { field.autofill.fields.forEach(element => { - for (var [key1, value1] of Object.entries(element)) { + for (let [key1, value1] of Object.entries(element)) { this.createPath(this.model, key1, this.ObjectbyString(res, value1)) this.form2.get(key1).setValue(this.ObjectbyString(res, value1)) } @@ -734,7 +734,7 @@ exLength : number = 0 } if (field.autofill.dropdowns) { field.autofill.dropdowns.forEach(element => { - for (var [key1, value1] of Object.entries(element)) { + for (let [key1, value1] of Object.entries(element)) { this.schema["properties"][key1]['items']['enum'] = this.ObjectbyString(res, value1) } }); @@ -1232,7 +1232,7 @@ let entity = this.entityName.charAt(0).toUpperCase() + this.entityName.slice(1); s = s.replace(/\[(\w+)\]/g, '.$1'); s = s.replace(/^\./, ''); var a = s.split('.'); - for (var i = 0, n = a.length; i < n; ++i) { + for (let i = 0, n = a.length; i < n; ++i) { var k = a[i]; if (k in o) { o = o[k]; @@ -1262,7 +1262,7 @@ let entity = this.entityName.charAt(0).toUpperCase() + this.entityName.slice(1); if (typeof obj !== 'object') { return false; } - for (var key in obj) { + for (let key in obj) { if (obj.hasOwnProperty(key)) { var t = path; var v = obj[key]; diff --git a/src/app/layouts/layouts.component.ts b/src/app/layouts/layouts.component.ts index d30ae30..bcfcf52 100644 --- a/src/app/layouts/layouts.component.ts +++ b/src/app/layouts/layouts.component.ts @@ -127,7 +127,7 @@ export class LayoutsComponent implements OnInit, OnChanges { if (block.fields.includes && block.fields.includes.length > 0) { if (block.fields.includes == "*") { - for (var element in this.model) { + for (let element in this.model) { if (!Array.isArray(this.model[element])) { if (typeof this.model[element] == 'string') { temp_object = this.responseData['definitions'][block.definition]['properties'][element] @@ -386,7 +386,7 @@ export class LayoutsComponent implements OnInit, OnChanges { pushData(data) { var object = {}; - for (var key in data) { + for (let key in data) { if (data.hasOwnProperty(key)) object[key] = data[key]; } diff --git a/src/app/tables/tables.component.ts b/src/app/tables/tables.component.ts index 5d4fb68..637904d 100644 --- a/src/app/tables/tables.component.ts +++ b/src/app/tables/tables.component.ts @@ -102,7 +102,7 @@ export class TablesComponent implements OnInit { pushData(data) { var object = {}; - for (var key in data) { + for (let key in data) { if (data.hasOwnProperty(key)) object[key] = data[key]; }