e89da943d8f0c87d38ebc3f3152c4ed0c5fc7479
[genesis.git] / fuel / build / f_lith_odl_docker / Makefile
1 ##############################################################################
2 # Copyright (c) 2015 Ericsson AB and others.
3 # stefan.k.berg@ericsson.com
4 # jonas.bjurel@ericsson.com
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10
11 TOP := $(shell pwd)
12 BUILDTAG := robust_stefan
13 RELEASE := Lithium_rc0
14
15 # Edit this to match the GENESIS / OPNFV in your environment
16 export OPNFV_PUPPET := $(BUILD_BASE)/../../common/puppet-opnfv
17 include ../config.mk
18
19 .PHONY: all
20 all:
21         @mkdir -p puppet/modules/opnfv/odl_docker/${RELEASE}
22         @rm -rf tmp
23         @mkdir -p tmp
24         @cp -Rvp ${OPNFV_PUPPET}/manifests/templates/${RELEASE}/dockerfile tmp/.
25         @docker build -t ${BUILDTAG} tmp/dockerfile/.
26         @docker save ${BUILDTAG} > puppet/modules/opnfv/odl_docker/${RELEASE}/odl_docker_image.tar
27         @wget ${DOCKER_REPO}/${DOCKER_TAG} -O  puppet/modules/opnfv/odl_docker/${RELEASE}/docker-latest
28         @echo "OPFNV_PUPPET is: ${OPNFV_PUPPET}"
29         @cp -Rvp ${OPNFV_PUPPET}/manifests/templates/${RELEASE}/dockerfile/container_scripts  puppet/modules/opnfv/odl_docker/${RELEASE}/.
30
31 .PHONY: clean
32 clean:
33         @rm -rf tmp
34         @rm -rf release
35
36 .PHONY: build-clean
37 build-clean:
38         @rm -rf tmp
39         @rm -rf release
40         @rm -rf puppet/modules/opnfv/odl_docker/${RELEASE}/odl_docker_image.tar
41         @rm -rf puppet/modules/opnfv/odl_docker/${RELEASE}/docker-latest
42
43 .PHONY: validate-cache
44 validate-cache:
45         @echo "No cache validation schema available for $(shell pwd)"
46         @echo "Continuing ..."
47
48 .PHONY: release
49 release:
50         # Fetch PP from OPNFV Common
51         @cp -Rvp ${OPNFV_PUPPET}/manifests/odl_docker.pp ${PUPPET_DEST}
52         @cp -Rvp puppet/modules/* $(PUPPET_DEST)