Add initial meta-stx to support StarlingX build
[pti/rtp.git] / meta-stx / recipes-core / stx-openstack-armada-app / openstack-helm_1.0.bb
1 #
2 ## Copyright (C) 2019 Wind River Systems, Inc.
3 #
4 #  Licensed under the Apache License, Version 2.0 (the "License");
5 #  you may not use this file except in compliance with the License.
6 #  You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #  Unless required by applicable law or agreed to in writing, software
11 #  distributed under the License is distributed on an "AS IS" BASIS,
12 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #  See the License for the specific language governing permissions and
14 #  limitations under the License.
15
16 SUMMARY = "Openstack Helm charts"
17 DESCRIPTION = "Openstack Helm charts"
18
19 LICENSE = "Apache-2.0"
20 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
21
22 DEPENDS += " \
23     helm-native \
24     openstack-helm-infra \
25 "
26
27 PROTOCOL = "https"
28 BRANCH = "r/stx.3.0"
29 SRCREV_openstack-helm = "82c72367c85ca94270f702661c7b984899c1ae38"
30 SRCREV_openstack-armada-app = "863f4b9733d3d4f4fd490606a94b84cfdaf2df2c"
31
32 SRC_URI = " \
33     git://github.com/openstack/openstack-helm;protocol=${PROTOCOL};name=openstack-helm \
34     git://opendev.org/starlingx/openstack-armada-app;protocol=${PROTOCOL};branch=${BRANCH};name=openstack-armada-app;destsuffix=openstack-armada-app \
35 "
36
37 S = "${WORKDIR}/git"
38
39 inherit allarch
40
41 patch_folder = "${WORKDIR}/openstack-armada-app/openstack-helm/files"
42 helm_folder = "${nonarch_libdir}/helm"
43 toolkit_version = "0.1.0"
44 helmchart_version = "0.1.0"
45
46 do_patch () {
47         cd ${S}
48         git am ${patch_folder}/0001-Ceilometer-chart-add-the-ability-to-publish-events-t.patch
49         git am ${patch_folder}/0002-Remove-stale-Apache2-service-pids-when-a-POD-starts.patch
50         git am ${patch_folder}/0003-Nova-console-ip-address-search-optionality.patch
51         git am ${patch_folder}/0004-Nova-chart-Support-ephemeral-pool-creation.patch
52         git am ${patch_folder}/0005-Nova-Add-support-for-disabling-Readiness-Liveness-pr.patch
53         git am ${patch_folder}/0006-Add-Placement-Chart.patch
54 }
55
56 do_configure () {
57         :
58 }
59
60 do_compile () {
61         # initialize helm and build the toolkit
62         # helm init --client-only does not work if there is no networking
63         # The following commands do essentially the same as: helm init
64         export HOME="${B}/${USER}"
65         export helm_home="${B}/${USER}/.helm"
66         rm -rf ${helm_home}
67
68         mkdir -p ${helm_home}
69         mkdir ${helm_home}/repository
70         mkdir ${helm_home}/repository/cache
71         mkdir ${helm_home}/repository/local
72         mkdir ${helm_home}/plugins
73         mkdir ${helm_home}/starters
74         mkdir ${helm_home}/cache
75         mkdir ${helm_home}/cache/archive
76
77         # Stage a repository file that only has a local repo
78         install -m 0644 ${patch_folder}/repositories.yaml ${helm_home}/repository/repositories.yaml
79
80         # Stage a local repo index that can be updated by the build
81         install -m 0644 ${patch_folder}/index.yaml ${helm_home}/repository/local/index.yaml
82
83         # Stage helm-toolkit in the local repo
84         cp ${RECIPE_SYSROOT}${helm_folder}/helm-toolkit-${toolkit_version}.tgz .
85
86         # Host a server for the charts
87         helm serve --repo-path . &
88         helm repo rm local
89         helm repo add local http://localhost:8879/charts
90
91         # Make the charts. These produce a tgz file
92         make aodh
93         make barbican
94         make ceilometer
95         make cinder
96         make glance
97         make heat
98         make horizon
99         make ironic
100         make keystone
101         make magnum
102         make neutron
103         make nova
104         make panko
105         make placement
106
107         # terminate helm server
108         pid=`/bin/pidof helm`
109         kill ${pid}
110         rm -rf ${helm_home}
111
112         # Remove the helm-toolkit tarball
113         rm helm-toolkit-${toolkit_version}.tgz
114 }
115
116 do_install () {
117         install -d -m 755 ${D}${helm_folder}
118         install -p -D -m 755 ${B}/*.tgz ${D}${helm_folder}
119 }
120
121 FILES_${PN} = "${helm_folder}"
122
123 RDEPENDS_${PN} = " \
124     helm \
125     openstack-helm-infra \
126 "