3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
16 %define RPM_NAME caas-%{COMPONENT}
17 %define RPM_MAJOR_VERSION 1.0.0
18 %define RPM_MINOR_VERSION 7
19 %define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
20 %define DEPLOY_PATH %{_caas_lcm_path}/deploy
21 %define SU_PATH %{_caas_lcm_path}/su
24 Version: %{RPM_MAJOR_VERSION}
25 Release: %{RPM_MINOR_VERSION}%{?dist}
26 Summary: Containers as a Service Life Cycle Managemnet workflows
27 License: %{_platform_license}
29 Vendor: %{_platform_vendor}
30 Source0: %{name}-%{version}.tar.gz
32 Requires: rsync >= 3.1.0
35 This RPM contains Life Cycle Managemnet workflows for the CaaS subsystem.
43 mkdir -p %{buildroot}/%{SU_PATH}/
44 rsync -av su/* %{buildroot}/%{SU_PATH}/
46 mkdir -p %{buildroot}/%{DEPLOY_PATH}/
47 rsync -av deploy/* %{buildroot}/%{DEPLOY_PATH}/
49 mkdir -p %{buildroot}/%{_playbooks_path}/
50 rsync -av ansible/playbooks/pre_config_lcm.yaml %{buildroot}/%{_playbooks_path}/
52 mkdir -p %{buildroot}/%{_roles_path}/
53 rsync -av ansible/roles/pre_config_lcm %{buildroot}/%{_roles_path}/
55 # ------- set lcm path inside deploy
56 sed -i 's|{{ lcm_path }}|%{_caas_lcm_path}|g' %{buildroot}/%{DEPLOY_PATH}/roles/bm_onboard/tasks/main.yml
57 sed -i 's|{{ lcm_path }}|%{_caas_lcm_path}|g' %{buildroot}/%{DEPLOY_PATH}/roles/list_application_deployments/tasks/main.yml
58 sed -i 's|{{ lcm_path }}|%{_caas_lcm_path}|g' %{buildroot}/%{DEPLOY_PATH}/roles/list_application_packages/tasks/main.yml
59 sed -i 's|{{ lcm_path }}|%{_caas_lcm_path}|g' %{buildroot}/%{DEPLOY_PATH}/roles/list_docker_images/tasks/main.yml
60 sed -i 's|{{ caas_manifest_path }}|%{_caas_manifest_path}|g' %{buildroot}/%{DEPLOY_PATH}/group_vars/controller-1.caas_master/params.yml
61 # ------- set lcm path inside roles
62 sed -i 's|{{ lcm_path }}|%{_caas_lcm_path}|g' %{buildroot}/%{_roles_path}/pre_config_lcm/tasks/main.yml
68 %{_playbooks_path}/pre_config_lcm.yaml
69 %{_roles_path}/pre_config_lcm
74 mkdir -p %{_postconfig_path}/
75 ln -sf %{_playbooks_path}/pre_config_lcm.yaml %{_postconfig_path}/
79 rm -f %{_postconfig_path}/pre_config_lcm.yaml