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.
15 %define COMPONENT netwatcher
16 %define RPM_NAME caas-%{COMPONENT}
17 %define RPM_MAJOR_VERSION 3.3.0
18 %define RPM_MINOR_VERSION 2
19 %define DANM_VERSION v%{RPM_MAJOR_VERSION}
20 %define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
23 Version: %{RPM_MAJOR_VERSION}
24 Release: %{RPM_MINOR_VERSION}%{?dist}
25 Summary: Containers as a Service netwatcher component
26 License: %{_platform_license} and BSD 3-Clause License
27 URL: https://github.com/nokia/danm
29 Vendor: %{_platform_vendor} and Nokia
30 Source0: %{name}-%{version}.tar.gz
32 Requires: docker-ce >= 18.09.2
33 BuildRequires: docker-ce >= 18.09.2
36 This RPM contains the netwatcher container image, and related deployment artifacts for the CaaS subsystem.
46 --build-arg HTTP_PROXY="${http_proxy}" \
47 --build-arg HTTPS_PROXY="${https_proxy}" \
48 --build-arg NO_PROXY="${no_proxy}" \
49 --build-arg http_proxy="${http_proxy}" \
50 --build-arg https_proxy="${https_proxy}" \
51 --build-arg no_proxy="${no_proxy}" \
52 --build-arg NETWATCHER="%{DANM_VERSION}" \
53 --tag %{COMPONENT}:%{IMAGE_TAG} \
54 %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-build/%{COMPONENT}/
56 mkdir -p %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-save/
58 docker save %{COMPONENT}:%{IMAGE_TAG} | gzip -c > %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-save/%{COMPONENT}:%{IMAGE_TAG}.tar
60 docker rmi -f %{COMPONENT}:%{IMAGE_TAG}
63 mkdir -p %{buildroot}/%{_caas_container_tar_path}/
64 rsync -av %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-save/%{COMPONENT}:%{IMAGE_TAG}.tar %{buildroot}/%{_caas_container_tar_path}/
66 mkdir -p %{buildroot}/%{_playbooks_path}/
67 rsync -av ansible/playbooks/danm_setup.yaml %{buildroot}/%{_playbooks_path}/
69 mkdir -p %{buildroot}/%{_roles_path}/
70 rsync -av ansible/roles/danm_setup %{buildroot}/%{_roles_path}/
73 %{_caas_container_tar_path}/%{COMPONENT}:%{IMAGE_TAG}.tar
74 %{_playbooks_path}/danm_setup.yaml
75 %{_roles_path}/danm_setup
80 mkdir -p %{_postconfig_path}/
81 ln -sf %{_playbooks_path}/danm_setup.yaml %{_postconfig_path}/
85 rm -f %{_postconfig_path}/danm_setup.yaml