armada-app: fix build failure on centos
[pti/rtp.git] / meta-stx / recipes-core / stx-openstack-armada-app / openstack-helm-infra_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-Infra charts"
17 DESCRIPTION = "Openstack-Helm-Infra 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 += "helm-native"
23
24 PROTOCOL = "https"
25 BRANCH = "r/stx.3.0"
26 SRCREV_openstack-helm-infra = "c9d6676bf9a5aceb311dc31dadd07cba6a3d6392"
27 SRCREV_openstack-armada-app = "863f4b9733d3d4f4fd490606a94b84cfdaf2df2c"
28
29 SRC_URI = " \
30     git://github.com/openstack/openstack-helm-infra;protocol=${PROTOCOL};name=openstack-helm-infra \
31     git://opendev.org/starlingx/openstack-armada-app;protocol=${PROTOCOL};branch=${BRANCH};name=openstack-armada-app;destsuffix=openstack-armada-app \
32 "
33
34 S = "${WORKDIR}/git"
35
36 inherit allarch
37
38 patch_folder = "${WORKDIR}/openstack-armada-app/openstack-helm-infra/files"
39 helm_folder = "${nonarch_libdir}/helm"
40
41 do_patch () {
42         cd ${S}
43         git am ${patch_folder}/0001-Allow-multiple-containers-per-daemonset-pod.patch
44         git am ${patch_folder}/0002-Add-imagePullSecrets-in-service-account.patch
45         git am ${patch_folder}/0003-Set-Min-NGINX-handles.patch
46         git am ${patch_folder}/0004-Partial-revert-of-31e3469d28858d7b5eb6355e88b6f49fd6.patch
47         git am ${patch_folder}/0005-Add-TLS-support-for-Gnocchi-public-endpoint.patch
48         git am ${patch_folder}/0006-Fix-pod-restarts-on-all-workers-when-worker-added-re.patch
49         git am ${patch_folder}/0007-Add-io_thread_pool-for-rabbitmq.patch
50         git am ${patch_folder}/0008-Enable-override-of-rabbitmq-probe-parameters.patch
51 }
52
53 do_configure () {
54         :
55 }
56
57 do_compile () {
58         # initialize helm and build the toolkit
59         # helm init --client-only does not work if there is no networking
60         # The following commands do essentially the same as: helm init
61         export HOME="${B}/${USER}"
62         export helm_home="${B}/${USER}/.helm"
63         rm -rf ${helm_home}
64
65         mkdir -p ${helm_home}
66         mkdir ${helm_home}/repository
67         mkdir ${helm_home}/repository/cache
68         mkdir ${helm_home}/repository/local
69         mkdir ${helm_home}/plugins
70         mkdir ${helm_home}/starters
71         mkdir ${helm_home}/cache
72         mkdir ${helm_home}/cache/archive
73
74         # Stage a repository file that only has a local repo
75         install -m 0644 ${patch_folder}/repositories.yaml \
76                 ${helm_home}/repository/repositories.yaml
77
78         # Host a server for the charts
79         tmpdir=`mktemp -d ${B}/charts-XXXXXX`
80         helm serve ${tmpdir} --address localhost:8879 --url http://localhost:8879/charts &
81         sleep 1
82         helm repo rm local
83         helm repo add local http://localhost:8879/charts
84
85         # Make the charts. These produce tgz files
86         make helm-toolkit
87         make gnocchi
88         make ingress
89         make libvirt
90         make mariadb
91         make memcached
92         make openvswitch
93         make rabbitmq
94         make ceph-rgw
95
96         # terminate helm server (the last backgrounded task)
97         kill $!
98         rm -rf ${helm_home}
99 }
100
101 do_install () {
102         install -d -m 755 ${D}${helm_folder}
103         install -p -D -m 755 ${B}/*.tgz ${D}${helm_folder}
104 }
105
106 FILES_${PN} = "${helm_folder}"
107
108 RDEPENDS_${PN} = "helm"