Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-flock / stx-openstack-armada-app / stx-openstack-helm_1.0.bb
1
2 SUMMARY = "StarlingX Openstack Application Helm charts"
3 DESCRIPTION = "StarlingX Openstack Application Helm 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     openstack-helm \
11     openstack-helm-infra \
12     stx-platform-helm \
13 "
14
15 PROTOCOL = "https"
16 BRANCH = "r/stx.3.0"
17 SRCREV = "863f4b9733d3d4f4fd490606a94b84cfdaf2df2c"
18
19 SRC_URI = "git://opendev.org/starlingx/openstack-armada-app;protocol=${PROTOCOL};branch=${BRANCH}"
20
21 S = "${WORKDIR}/git/stx-openstack-helm/stx-openstack-helm"
22
23 inherit allarch
24
25 helm_folder = "${nonarch_libdir}/helm"
26 armada_folder = "${nonarch_libdir}/armada"
27 app_folder = "${nonarch_libdir}/application"
28 toolkit_version = "0.1.0"
29 helmchart_version = "0.1.0"
30
31 do_configure[noexec] = "1"
32
33 do_compile () {
34         # initialize helm and build the toolkit
35         # helm init --client-only does not work if there is no networking
36         # The following commands do essentially the same as: helm init
37         export HOME="${B}/${USER}"
38         export helm_home="${B}/${USER}/.helm"
39         rm -rf ${helm_home}
40
41         mkdir -p ${helm_home}
42         mkdir ${helm_home}/repository
43         mkdir ${helm_home}/repository/cache
44         mkdir ${helm_home}/repository/local
45         mkdir ${helm_home}/plugins
46         mkdir ${helm_home}/starters
47         mkdir ${helm_home}/cache
48         mkdir ${helm_home}/cache/archive
49
50         # Stage a repository file that only has a local repo
51         cp ${S}/files/repositories.yaml ${helm_home}/repository/repositories.yaml
52
53         # Stage a local repo index that can be updated by the build
54         cp ${S}/files/index.yaml ${helm_home}/repository/local/index.yaml
55
56         # Stage helm-toolkit in the local repo
57         cp ${RECIPE_SYSROOT}${helm_folder}/helm-toolkit-${toolkit_version}.tgz .
58
59         # Host a server for the charts
60         helm serve --repo-path . &
61         sleep 1
62         helm repo rm local
63         helm repo add local http://localhost:8879/charts
64
65         # Make the charts. These produce a tgz file
66         cd ${S}/helm-charts
67         make nova-api-proxy
68         make garbd
69         make keystone-api-proxy
70         make fm-rest-api
71         make nginx-ports-control
72         make dcdbsync
73         cd -
74
75         # terminate helm server (the last backgrounded task)
76         kill $!
77         rm -rf ${helm_home}
78
79         # Remove the helm-toolkit tarball
80         rm helm-toolkit-${toolkit_version}.tgz
81 }
82
83 do_install () {
84         install -d -m 755 ${D}${app_folder}
85         install -p -D -m 755 ${S}/files/metadata.yaml ${D}${app_folder}
86         install -d -m 755 ${D}${helm_folder}
87         install -p -D -m 755 ${S}/helm-charts/*.tgz ${D}${helm_folder}
88         install -d -m 755 ${D}${armada_folder}
89         install -p -D -m 755 ${S}/manifests/*.yaml ${D}${armada_folder}
90 }
91
92 FILES_${PN} = " \
93     ${app_folder} \
94     ${helm_folder} \
95     ${armada_folder} \
96 "
97
98 RDEPENDS_${PN} = " \
99     helm \
100     openstack-helm \
101     openstack-helm-infra \
102 "