# Copyright © 2020 Samsung Electronics
+# Copyright (c) 2021 AT&T. All rights reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # limitations under the License.
 
 ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
-OUTPUT_DIR := $(ROOT_DIR)/../../dist
+OUTPUT_DIR := $(ROOT_DIR)/../dist
 PACKAGE_DIR := $(OUTPUT_DIR)/packages
 SECRET_DIR := $(OUTPUT_DIR)/secrets
 
+HELM_REPO := local
+
 EXCLUDES :=
 HELM_BIN := helm
 HELM_CHARTS := $(filter-out $(EXCLUDES), $(sort $(patsubst %/.,%,$(wildcard */.))))
 
 package-%: lint-%
        @mkdir -p $(PACKAGE_DIR)
-       @if [ -f $*/Chart.yaml ]; then $(HELM_BIN) package -d $(PACKAGE_DIR) $*; fi
-       @$(HELM_BIN) repo index $(PACKAGE_DIR)
+       @if [ -f $*/Chart.yaml ]; then PACKAGE_NAME=$$($(HELM_BIN) package -d $(PACKAGE_DIR) $* | cut -d":" -f2) && $(HELM_BIN) push -f $$PACKAGE_NAME $(HELM_REPO); fi
+       @sleep 3
 
 clean:
        @rm -f */requirements.lock
 
 # Copyright © 2020 Samsung Electronics
+# Copyright (c) 2021 AT&T. All rights reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 PACKAGE_DIR := $(OUTPUT_DIR)/packages
 SECRET_DIR := $(OUTPUT_DIR)/secrets
 
+HELM_REPO := local
+
 EXCLUDES :=
 HELM_BIN := helm
 HELM_CHARTS := $(filter-out $(EXCLUDES), $(sort $(patsubst %/.,%,$(wildcard */.))))
 
 package-%: lint-%
        @mkdir -p $(PACKAGE_DIR)
-       @if [ -f $*/Chart.yaml ]; then $(HELM_BIN) package -d $(PACKAGE_DIR) $*; fi
-       @$(HELM_BIN) repo index $(PACKAGE_DIR)
+       @if [ -f $*/Chart.yaml ]; then PACKAGE_NAME=$$($(HELM_BIN) package -d $(PACKAGE_DIR) $* | cut -d":" -f2) && $(HELM_BIN) push -f $$PACKAGE_NAME $(HELM_REPO); fi
+       @sleep 3
 
 clean:
        @rm -f */requirements.lock
 
 # Copyright © 2020 Samsung Electronics
+# Copyright (c) 2021 AT&T. All rights reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 PACKAGE_DIR := $(OUTPUT_DIR)/packages
 SECRET_DIR := $(OUTPUT_DIR)/secrets
 
+HELM_REPO := local
+
 EXCLUDES :=
 HELM_BIN := helm
 HELM_CHARTS := $(filter-out $(EXCLUDES), $(sort $(patsubst %/.,%,$(wildcard */.))))
 
 package-%: lint-%
        @mkdir -p $(PACKAGE_DIR)
-       @if [ -f $*/Chart.yaml ]; then $(HELM_BIN) package -d $(PACKAGE_DIR) $*; fi
-       @$(HELM_BIN) repo index $(PACKAGE_DIR)
+       @if [ -f $*/Chart.yaml ]; then PACKAGE_NAME=$$($(HELM_BIN) package -d $(PACKAGE_DIR) $* | cut -d":" -f2) && $(HELM_BIN) push -f $$PACKAGE_NAME $(HELM_REPO); fi
+       @sleep 5
 
 clean:
        @rm -f */requirements.lock
 
 # Copyright (c) 2021 J. F. Lucas.  All rights reserved.
 # Copyright (c) 2021 Nokia.  All rights reserved.
+# Copyright (c) 2021 AT&T. All rights reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
     repository: '@local'
   - name: dcaegen2-services-common
     version: ~8.x-0
-    repository: 'file://../../common/dcaegen2-services-common'
+    repository: '@local'
   - name: certManagerCertificate
     version: ~8.x-0
     repository: '@local'
 
 # ================================ LICENSE_START =============================
 # ============================================================================
 # Copyright (C) 2021 Nordix Foundation.
+# Copyright (c) 2021 AT&T. All rights reserved.
 # ============================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 
 apiVersion: v1
 appVersion: "Honolulu"
-description: A Helm chart for DCAE PMSH
+description: DCAE PMSH Service
 name: dcae-pmsh
-version: 8.0.0
\ No newline at end of file
+version: 8.0.0
 
     repository: '@local'
   - name: dcaegen2-services-common
     version: ~8.x-0
-    repository: 'file://../../common/dcaegen2-services-common'
\ No newline at end of file
+    repository: '@local'
 
 # Copyright (c) 2021 J. F. Lucas.  All rights reserved.
+# Copyright (c) 2021 AT&T. All rights reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
     repository: '@local'
   - name: dcaegen2-services-common
     version: ~8.x-0
-    repository: 'file://../../common/dcaegen2-services-common'
+    repository: '@local'
 
 # Copyright (c) 2020 J. F. Lucas.  All rights reserved.
+# Copyright (c) 2021 AT&T. All rights reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
     repository: '@local'
   - name: dcaegen2-services-common
     version: ~8.x-0
-    repository: 'file://../../common/dcaegen2-services-common'
+    repository: '@local'
 
 # Copyright (c) 2021 J. F. Lucas.  All rights reserved.
 # Copyright (c) 2021 Nokia.  All rights reserved.
+# Copyright (c) 2021 AT&T. All rights reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
     repository: '@local'
   - name: dcaegen2-services-common
     version: ~8.x-0
-    repository: 'file://../../common/dcaegen2-services-common'
+    repository: '@local'
   - name: certManagerCertificate
     version: ~8.x-0
     repository: '@local'
 
 # Copyright (c) 2021 J. F. Lucas.  All rights reserved.
+# Copyright (c) 2021 AT&T. All rights reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
     repository: '@local'
   - name: dcae-ms-healthcheck
     version: ~8.x-0
-    repository: 'file://components/dcae-ms-healthcheck'
+    repository: '@local'
+    #repository: 'file://components/dcae-ms-healthcheck'
     condition: dcae-ms-healthcheck.enabled
   - name: dcae-pmsh
     version: ~8.x-0
-    repository: 'file://components/dcae-pmsh'
+    repository: '@local'
+    #repository: 'file://components/dcae-pmsh'
     condition: dcae-pmsh.enabled
   - name: dcae-prh
     version: ~8.x-0
-    repository: 'file://components/dcae-prh'
+    repository: '@local'
+    #repository: 'file://components/dcae-prh'
     condition: dcae-bootstrap.enabled
   - name: dcae-tcagen2
     version: ~8.x-0
-    repository: 'file://components/dcae-tcagen2'
+    repository: '@local'
+    #repository: 'file://components/dcae-tcagen2'
     condition: dcae-tcagen2.enabled
   - name: dcae-ves-collector
     version: ~8.x-0
-    repository: 'file://components/dcae-ves-collector'
+    repository: '@local'
+    #repository: 'file://components/dcae-ves-collector'
     condition: dcae-ves-collector.enabled
   - name: dcae-hv-ves-collector
     version: ~8.x-0
-    repository: 'file://components/dcae-hv-ves-collector'
+    repository: '@local'
+    #repository: 'file://components/dcae-hv-ves-collector'
     condition: dcae-hv-ves-collector.enabled