Skip to content
Snippets Groups Projects
Commit 2c237419 authored by Mike Marchetti's avatar Mike Marchetti Committed by Gerrit Code Review
Browse files

Merge "update descriptor-packages build process"

parents d969d9cd 230c540c
No related branches found
No related tags found
No related merge requests found
Showing
with 220 additions and 133 deletions
nsd/*/build
vnfd/*/build
#
# Copyright 2016 RIFT.IO Inc
# Copyright 2017 Sandvine
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......@@ -13,137 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Author(s): Austin Cormier
# Creation Date: 2016/05/23
#
BUILD_DIR = build
NSDS := \
gw_corpa_ns \
ims_allin1_corpa \
mwc16_gen_ns \
mwc16_pe_ns \
VyOS_ns \
cirros_ns \
cirros_2vnf_ns \
ubuntu_xenial_ns \
ping_pong_ns \
knt_flownac_ns \
knt_flownac-us_ns \
sandvine_pts_ns \
sonussbc_ns \
ref1_ns \
ref2_ns \
ubuntu_cirros_multidisk_ns
NSD_SRC_DIR := src/nsd
NSD_BUILD_DIR := $(BUILD_DIR)/nsd
NSD_SRC_DIRS := $(addprefix $(NSD_SRC_DIR)/, $(NSDS))
NSD_BUILD_DIRS := $(addprefix $(NSD_BUILD_DIR)/, $(NSDS))
NSD_PKGS := $(addsuffix .tar.gz, $(NSDS))
NSD_BUILD_PKGS := $(addprefix $(NSD_BUILD_DIR)_pkgs/, $(NSD_PKGS))
VNFDS := \
6wind_vnf \
gw_corpa_pe1_vnf \
gw_corpa_pe2_vnf \
ims_allin1_2p_vnf \
tidgen_mwc16_vnf \
VyOS_vnf \
cirros_vnf \
ubuntu_xenial_vnf \
ping_vnf \
pong_vnf \
knt_fnc_vnf \
knt_fne_vnf \
knt_fnu_vnf \
knt_fnd_vnf \
sandvine_pts_vnf \
sonus_sbc_vnf \
sonus_test_vnf \
ref11_vnf \
ref21_vnf \
ref12_vnf \
ref22_vnf \
ubuntu_cirros_multidisk_vnf
VNFD_SRC_DIR := src/vnfd
VNFD_BUILD_DIR := $(BUILD_DIR)/vnfd
VNFD_SRC_DIRS := $(addprefix $(VNFD_SRC_DIR)/, $(VNFDS))
VNFD_BUILD_DIRS := $(addprefix $(VNFD_BUILD_DIR)/, $(VNFDS))
VNFD_PKGS := $(addsuffix .tar.gz, $(VNFDS))
VNFD_BUILD_PKGS := $(addprefix $(VNFD_BUILD_DIR)_pkgs/, $(VNFD_PKGS))
IMS_GITHUB="https://github.com/Metaswitch/clearwater-juju.git"
CHARM_REPO="https://osm.etsi.org/gerrit/osm/juju-charms.git"
all: $(VNFD_BUILD_PKGS) ${NSD_BUILD_PKGS}
echo $@
clean:
-@ $(RM) -rf $(BUILD_DIR)
$(VNFD_BUILD_DIR)/%: $(VNFD_SRC_DIR)/%
mkdir -p $(VNFD_BUILD_DIR)
cp -rf $< $(VNFD_BUILD_DIR)
src/gen_vnfd_pkg.sh $< $@
$(BUILD_DIR)/clearwater-juju:
mkdir -p $(BUILD_DIR)
-cd $(BUILD_DIR) && (test -e clearwater-juju || git clone $(IMS_GITHUB))
$(BUILD_DIR)/juju-charms:
mkdir -p $(BUILD_DIR)
-cd $(BUILD_DIR) && (test -e juju-charms || git clone $(CHARM_REPO))
-cd $(BUILD_DIR)/juju-charms && make
$(NSD_BUILD_DIR)/%: $(NSD_SRC_DIR)/%
mkdir -p $(NSD_BUILD_DIR)
cp -rf $< $(NSD_BUILD_DIR)
src/gen_nsd_pkg.sh $< $@
$(BUILD_DIR)/nsd_pkgs/%.tar.gz: $(NSD_BUILD_DIR)/%
src/generate_descriptor_pkg.sh -d $(BUILD_DIR)/nsd_pkgs $<
$(VNFD_BUILD_DIR)/ims_allin1_2p_vnf/charms/clearwater-aio-proxy: $(VNFD_BUILD_DIR)/ims_allin1_2p_vnf $(BUILD_DIR)/clearwater-juju
# Copy the IMS Charm into the IMS vnf package directory before packaging
cp -rf $(BUILD_DIR)/clearwater-juju/charms/trusty/clearwater-aio-proxy $(VNFD_BUILD_DIR)/ims_allin1_2p_vnf/charms
$(VNFD_BUILD_DIR)/6wind_vnf/charms/vpe-router: $(VNFD_BUILD_DIR)/6wind_vnf $(BUILD_DIR)/juju-charms
# Copy the PE Charm into the PE vnf package directory before packaging
cp -rf $(BUILD_DIR)/juju-charms/builds/vpe-router $(VNFD_BUILD_DIR)/6wind_vnf/charms
$(VNFD_BUILD_DIR)/VyOS_vnf/charms/vyos-proxy: $(VNFD_BUILD_DIR)/VyOS_vnf $(BUILD_DIR)/juju-charms
# Copy the PE Charm into the PE vnf package directory before packaging
cp -rf $(BUILD_DIR)/juju-charms/builds/vyos-proxy $(VNFD_BUILD_DIR)/VyOS_vnf/charms
$(VNFD_BUILD_DIR)/ping_vnf/charms/pingpong: $(VNFD_BUILD_DIR)/ping_vnf $(BUILD_DIR)/juju-charms
# Copy the pingpong Charm into the ping vnf package directory before packaging
cp -rf $(BUILD_DIR)/juju-charms/builds/pingpong $(VNFD_BUILD_DIR)/ping_vnf/charms
$(VNFD_BUILD_DIR)/pong_vnf/charms/pingpong: $(VNFD_BUILD_DIR)/pong_vnf $(BUILD_DIR)/juju-charms
# Copy the pingpong Charm into the pong vnf package directory before packaging
cp -rf $(BUILD_DIR)/juju-charms/builds/pingpong $(VNFD_BUILD_DIR)/pong_vnf/charms
$(VNFD_BUILD_DIR)/knt_fnc_vnf/charms/flownac: $(VNFD_BUILD_DIR)/knt_fnc_vnf $(BUILD_DIR)/juju-charms
# Copy the FlowNAC Charm into the FNC vnf package directory before packaging
cp -rf $(BUILD_DIR)/juju-charms/builds/flownac $(VNFD_BUILD_DIR)/knt_fnc_vnf/charms
$(VNFD_BUILD_DIR)/knt_fne_vnf/charms/flownac: $(VNFD_BUILD_DIR)/knt_fne_vnf $(BUILD_DIR)/juju-charms
# Copy the FlowNAC Charm into the FNE vnf package directory before packaging
cp -rf $(BUILD_DIR)/juju-charms/builds/flownac $(VNFD_BUILD_DIR)/knt_fne_vnf/charms
$(VNFD_BUILD_DIR)/knt_fnd_vnf/charms/flownac: $(VNFD_BUILD_DIR)/knt_fnd_vnf $(BUILD_DIR)/juju-charms
# Copy the FlowNAC Charm into the FND vnf package directory before packaging
cp -rf $(BUILD_DIR)/juju-charms/builds/flownac $(VNFD_BUILD_DIR)/knt_fnd_vnf/charms
$(VNFD_BUILD_DIR)/knt_fnu_vnf/charms/flownac: $(VNFD_BUILD_DIR)/knt_fnu_vnf $(BUILD_DIR)/juju-charms
# Copy the FlowNAC Charm into the FNU vnf package directory before packaging
cp -rf $(BUILD_DIR)/juju-charms/builds/flownac $(VNFD_BUILD_DIR)/knt_fnu_vnf/charms
SUBDIRS = vnfd nsd
$(BUILD_DIR)/vnfd_pkgs/%.tar.gz: $(VNFD_BUILD_DIR)/% $(VNFD_BUILD_DIR)/ims_allin1_2p_vnf/charms/clearwater-aio-proxy $(VNFD_BUILD_DIR)/6wind_vnf/charms/vpe-router $(VNFD_BUILD_DIR)/VyOS_vnf/charms/vyos-proxy $(VNFD_BUILD_DIR)/ping_vnf/charms/pingpong $(VNFD_BUILD_DIR)/pong_vnf/charms/pingpong $(VNFD_BUILD_DIR)/knt_fnc_vnf/charms/flownac $(VNFD_BUILD_DIR)/knt_fne_vnf/charms/flownac $(VNFD_BUILD_DIR)/knt_fnd_vnf/charms/flownac $(VNFD_BUILD_DIR)/knt_fnu_vnf/charms/flownac
src/generate_descriptor_pkg.sh -d $(BUILD_DIR)/vnfd_pkgs $<
include mk/dirs.mk
#
# Copyright 2017 Sandvine
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
SUBDIRS_CLEAN = $(addsuffix .clean, $(SUBDIRS))
.PHONY: $(SUBDIRS) $(SUBDIRS_CLEAN) clean
all: $(SUBDIRS)
clean: $(SUBDIRS_CLEAN)
$(SUBDIRS_CLEAN): %.clean:
@$(MAKE) --no-print-directory -C $* clean
$(SUBDIRS):
@$(MAKE) --no-print-directory -C $@
#
# Copyright 2017 Sandvine
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
TOPDIR=$(shell readlink -f .|sed -e 's/\/descriptor-packages\/.*//')
BUILD_DIR := build
TOOLS_DIR := $(TOPDIR)/descriptor-packages/tools
PKG_BASE_NAME := $(shell basename $(shell pwd))
PKG_NAME := $(addsuffix .tar.gz, $(PKG_BASE_NAME))
CHARM_DIR := $(TOPDIR)/juju-charms
CHARM_SRC_DIR := $(CHARM_DIR)/layers
CHARM_DOCKER_TAG := charm-tools
CHARM_BUILD_DIR := $(CHARM_DIR)/builds
Q=@
GEN_VNFD_PKG := $(TOOLS_DIR)/gen_vnfd_pkg.sh
GEN_NSD_PKG := $(TOOLS_DIR)/gen_nsd_pkg.sh
GEN_PKG := $(TOOLS_DIR)/generate_descriptor_pkg.sh
BUILD_VNFD := $(shell readlink -f .|sed -e 's/\/.*descriptor-packages//' | grep vnfd)
DEP_FILES = $(wildcard src/*)
ifdef BUILD_VNFD
$(BUILD_DIR)/$(PKG_BASE_NAME): src $(DEP_FILES)
$(Q)mkdir -p $@
$(Q)cp -rf $</. $@
$(Q)$(GEN_VNFD_PKG) $< $@
else
$(BUILD_DIR)/$(PKG_BASE_NAME): src $(DEP_FILES)
$(Q)mkdir -p $@
$(Q)cp -rf $</. $@
$(Q)$(GEN_NSD_PKG) $< $@
endif
ifdef VNFD_CHARM
$(BUILD_DIR)/$(PKG_NAME): $(BUILD_DIR)/$(PKG_BASE_NAME) $(CHARM_BUILD_DIR)/$(VNFD_CHARM)
$(Q)echo "building $(PKG_BASE_NAME) with charm $(VNFD_CHARM)"
$(Q)cp -rf $(CHARM_BUILD_DIR)/$(VNFD_CHARM) $(BUILD_DIR)/$(PKG_BASE_NAME)/charms
$(Q)$(GEN_PKG) --no-remove-files -d $(BUILD_DIR) $(BUILD_DIR)/$(PKG_BASE_NAME)
else
$(BUILD_DIR)/$(PKG_NAME): $(BUILD_DIR)/$(PKG_BASE_NAME)
$(Q)echo "building $(PKG_BASE_NAME)"
$(Q)$(GEN_PKG) --no-remove-files -d $(BUILD_DIR) $(BUILD_DIR)/$(PKG_BASE_NAME)
endif
$(CHARM_BUILD_DIR)/%: $(CHARM_SRC_DIR)/%
$(Q)docker build -q -t $(CHARM_DOCKER_TAG) $(CHARM_DIR)/.
$(Q)docker run -u $$(id -u):$$(id -g) -v$(CHARM_DIR):$(CHARM_DIR) -w$(CHARM_DIR) $(CHARM_DOCKER_TAG) charm-build -o $(CHARM_DIR) $<
clean:
$(Q)rm -rf $(BUILD_DIR)
$(Q)rm -rf $(CHARM_BUILD_DIR)
.DEFAULT_GOAL := all
#
# Copyright 2017 Sandvine
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
SUBDIRS = $(wildcard */)
TOPDIR ?= ../
include $(TOPDIR)/mk/dirs.mk
#
# Copyright 2017 Sandvine
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
DESCRIPTORS_TOPDIR ?= ../..
include $(DESCRIPTORS_TOPDIR)/mk/pkg.mk
all: $(BUILD_DIR)/$(PKG_NAME)
#
# Copyright 2017 Sandvine
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
DESCRIPTORS_TOPDIR ?= ../..
include $(DESCRIPTORS_TOPDIR)/mk/pkg.mk
all: $(BUILD_DIR)/$(PKG_NAME)
#
# Copyright 2017 Sandvine
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
DESCRIPTORS_TOPDIR ?= ../..
include $(DESCRIPTORS_TOPDIR)/mk/pkg.mk
all: $(BUILD_DIR)/$(PKG_NAME)
#
# Copyright 2017 Sandvine
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
DESCRIPTORS_TOPDIR ?= ../..
include $(DESCRIPTORS_TOPDIR)/mk/pkg.mk
all: $(BUILD_DIR)/$(PKG_NAME)
#
# Copyright 2017 Sandvine
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
DESCRIPTORS_TOPDIR ?= ../..
include $(DESCRIPTORS_TOPDIR)/mk/pkg.mk
all: $(BUILD_DIR)/$(PKG_NAME)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment