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 2
19 %define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
20 %define LCM_PATH /opt/caas_lcm
21 %define DEPLOY_PATH %{LCM_PATH}/deploy
22 %define SU_PATH %{LCM_PATH}/su
25 Version: %{RPM_MAJOR_VERSION}
26 Release: %{RPM_MINOR_VERSION}%{?dist}
27 Summary: Containers as a Service Life Cycle Managemnet workflows
28 License: %{_platform_license}
30 Vendor: %{_platform_vendor}
31 Source0: %{name}-%{version}.tar.gz
33 Requires: rsync >= 3.1.0
36 This RPM contains Life Cycle Managemnet workflows for the CaaS subsystem.
44 mkdir -p %{buildroot}/%{SU_PATH}/
45 rsync -av su/* %{buildroot}/%{SU_PATH}/
47 mkdir -p %{buildroot}/%{DEPLOY_PATH}/
48 rsync -av deploy/* %{buildroot}/%{DEPLOY_PATH}/
50 mkdir -p %{buildroot}/%{_playbooks_path}/
51 rsync -av ansible/playbooks/pre_config_lcm.yaml %{buildroot}/%{_playbooks_path}/
53 mkdir -p %{buildroot}/%{_roles_path}/
54 rsync -av ansible/roles/pre_config_lcm %{buildroot}/%{_roles_path}/
56 # ------- set lcm path inside deploy
57 sed -i 's|{{ lcm_path }}|%{LCM_PATH}|g' %{buildroot}/%{DEPLOY_PATH}/roles/bm_onboard/tasks/main.yml
58 sed -i 's|{{ lcm_path }}|%{LCM_PATH}|g' %{buildroot}/%{DEPLOY_PATH}/roles/list_application_deployments/tasks/main.yml
59 sed -i 's|{{ lcm_path }}|%{LCM_PATH}|g' %{buildroot}/%{DEPLOY_PATH}/roles/list_application_packages/tasks/main.yml
60 sed -i 's|{{ lcm_path }}|%{LCM_PATH}|g' %{buildroot}/%{DEPLOY_PATH}/roles/list_docker_images/tasks/main.yml
61 sed -i 's|{{ caas_manifest_path }}|%{_caas_manifest_path}|g' %{buildroot}/%{DEPLOY_PATH}/group_vars/controller-1.caas_master/params.yml
62 # ------- set lcm path inside roles
63 sed -i 's|{{ lcm_path }}|%{LCM_PATH}|g' %{buildroot}/%{_roles_path}/pre_config_lcm/tasks/main.yml
69 %{_playbooks_path}/pre_config_lcm.yaml
70 %{_roles_path}/pre_config_lcm
75 mkdir -p %{_postconfig_path}/
76 ln -sf %{_playbooks_path}/pre_config_lcm.yaml %{_postconfig_path}/
80 rm -f %{_postconfig_path}/pre_config_lcm.yaml