Updates docs for SR1 with final revision
[genesis.git] / fuel / build / f_isoroot / f_repobuild / 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 SHELL := /bin/bash
12 TOP := $(shell pwd)
13 DOCKNAME = fuelrepo
14 DOCKVERSION = 1.0
15
16 # try to choose close ubuntu mirror which support rsync protocol
17 # https://bugs.launchpad.net/fuel/+bug/1459252
18 MIRROR_URLS := $(shell curl -s http://mirrors.ubuntu.com/mirrors.txt)
19 MIRROR_HOSTS := $(shell for url in ${MIRROR_URLS}; do echo $$url | cut -d'/' -f3; done)
20 RSYNC_HOST := $(shell for host in ${MIRROR_HOSTS}; do rsync -4 --contimeout 5 --no-motd --list-only "$${host}::ubuntu/." &> /dev/null && echo $$host && break; done)
21
22 .PHONY: all
23 all: .nailgun
24
25 .nailgun:
26         sudo apt-get update
27         sudo apt-get upgrade -y
28         sudo apt-get install -y rsync python python-yaml dpkg-dev openssl
29         rm -rf tmpiso tmpdir
30         mkdir tmpiso
31         fuseiso ${ISOCACHE} tmpiso
32         cp tmpiso/ubuntu/pool/main/f/fuel-createmirror/fuel-createmirror_6.1*.deb .
33         fusermount -u tmpiso
34         rm -rf tmpiso
35         sudo dpkg -i fuel-createmirror_6.1*.deb
36         sudo sed -i 's/DOCKER_MODE=true/DOCKER_MODE=false/' /etc/fuel-createmirror/common.cfg
37         sudo sed -i 's/DEBUG="no"/DEBUG="yes"/' /etc/fuel-createmirror/ubuntu.cfg
38         sudo sed -i 's/MIRROR_UBUNTU_HOST="archive.ubuntu.com"/MIRROR_UBUNTU_HOST="${RSYNC_HOST}"/' /etc/fuel-createmirror/common.cfg
39         rm -Rf nailgun
40         sudo mkdir -p /var/www
41         sudo su - -c /opt/fuel-createmirror-6.1/fuel-createmirror
42         sudo chmod -R 755 /var/www/nailgun
43         cp -Rp /var/www/nailgun .
44         touch .nailgun
45
46 .PHONY: clean
47 clean:
48         # Deliberately not cleaning nailgun directory to speed up multiple builds
49         @rm -rf ../release/opnfv/nailgun fuel-createmirror_6.1*.deb
50
51 .PHONY: release
52 release:.nailgun
53         @rm -Rf ../release/opnfv/nailgun
54         @mkdir -p ../release/opnfv
55         @cp -Rp nailgun ../release/opnfv/nailgun
56