Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-flock / stx-monitor-armada-app / monitor-helm-elastic_1.0.bb
1
2 SUMMARY = "Monitor Helm Elastic charts"
3 DESCRIPTION = "Monitor Helm Elastic charts"
4
5 LICENSE = "Apache-2.0"
6 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
7
8 DEPENDS += " \
9     helm-native \
10     stx-openstack-helm \
11 "
12
13 PROTOCOL = "https"
14 BRANCH = "r/stx.3.0"
15 SRCREV_helm-charts-elastic = "2bd7616ceddbdf2eee88965e2028ee37d304c79c"
16
17 # Patches pulled from:
18 # SRCREV_monitor-armada-app = "e5ee6b3a07b74479b93fe90eff0662cf81890f73"
19 # git://opendev.org/starlingx/monitor-armada-app.git
20
21 SRC_URI = " \
22     git://github.com/elastic/helm-charts;protocol=${PROTOCOL};name=helm-charts-elastic \
23     file://0001-add-makefile.patch \
24     file://0002-Add-compatibility-for-k8s-1.16.patch \
25     file://0003-use-oss-image.patch \
26     file://0004-Update-to-Elastic-7.4.0-Release.patch \
27     file://0005-set-initial-masters-to-master-0.patch \
28     file://index.yaml \
29     file://repositories.yaml \
30     "
31
32 PATCHTOOL = "git"
33 PATCH_COMMIT_FUNCTIONS = "1"
34
35 S = "${WORKDIR}/git"
36
37 inherit allarch
38
39 helm_folder = "${nonarch_libdir}/helm"
40 helmchart_version = "0.1.0"
41
42 do_configure[noexec] = "1"
43
44 do_compile () {
45         # initialize helm and build the toolkit
46         # helm init --client-only does not work if there is no networking
47         # The following commands do essentially the same as: helm init
48         export HOME="${B}/${USER}"
49         export helm_home="${B}/${USER}/.helm"
50         rm -rf ${helm_home}
51
52         mkdir -p ${helm_home}
53         mkdir ${helm_home}/repository
54         mkdir ${helm_home}/repository/cache
55         mkdir ${helm_home}/repository/local
56         mkdir ${helm_home}/plugins
57         mkdir ${helm_home}/starters
58         mkdir ${helm_home}/cache
59         mkdir ${helm_home}/cache/archive
60
61         # Stage a repository file that only has a local repo
62         install -m 0644 ${WORKDIR}/repositories.yaml \
63                 ${helm_home}/repository/repositories.yaml
64
65         # Stage a local repo index that can be updated by the build
66         install -m 0644 ${WORKDIR}/index.yaml ${helm_home}/repository/local/index.yaml
67
68         # Host a server for the charts
69         helm serve --repo-path . &
70         sleep 1
71         helm repo rm local
72         helm repo add local http://localhost:8879/charts
73
74         # Create the tgz files
75         rm -f elasticsearch/Makefile
76         make elasticsearch
77
78         # terminate helm server (the last backgrounded task)
79         kill $!
80         rm -rf ${helm_home}
81 }
82
83 do_install () {
84         install -d -m 755 ${D}${helm_folder}
85         install -p -D -m 755 ${B}/*.tgz ${D}${helm_folder}
86 }
87
88 FILES_${PN} = "${helm_folder}"
89
90 RDEPENDS_${PN} = " \
91     helm \
92     stx-platform-helm \
93     stx-openstack-helm \
94 "