SHELL := /bin/bash
TOP := $(shell pwd)
-UBUNTU_DIR := $(shell dirname $(MIRROR_UBUNTU_ROOT))
+TMP_ROOT_DIR := $(shell echo "$(MIRROR_UBUNTU_ROOT)" | cut -d "/" -f2)
+# Enable use of exact repo commit if defined, else use Fuel main branch
+FUEL_MIRROR_REPO?=https://github.com/openstack/fuel-mirror
+FUEL_MIRROR_COMMIT?=$(FUEL_MAIN_TAG)
include ../../config.mk
sudo apt-get install -y git libxml2-dev libxslt-dev python-dev python-pip libz-dev libyaml-dev createrepo python-yaml
rm -Rf nailgun
sudo mkdir -p /var/www/nailgun
- git clone -b $(FUEL_MAIN_TAG) https://github.com/openstack/fuel-mirror
+ git clone $(FUEL_MIRROR_REPO)
+ cd fuel-mirror && git checkout -q $(FUEL_MIRROR_COMMIT)
sudo pip install -U -r ./fuel-mirror/requirements.txt
sudo pip install ./fuel-mirror
sudo pip install ./fuel-mirror/contrib/fuel_mirror
./opnfv_mirror_conf.py
- sudo fuel-mirror --debug --config ./opnfv-config.yaml create --group mos ubuntu --pattern=ubuntu
+ sudo fuel-mirror --debug --config ./opnfv-config.yaml create --group ubuntu --pattern=ubuntu
sudo chmod -R 755 /var/www/nailgun
cp -Rp /var/www/nailgun .
- mv nailgun/mirrors$(MIRROR_MOS_UBUNTU_ROOT) nailgun/mirrors/mos-repos/ubuntu/$(MOS_VERSION)
- rmdir nailgun/mirrors/mos-repos/ubuntu/snapshots
- if [ "$(UBUNTU_DIR)" != "/" ]; then \
- mv nailgun/mirrors$(UBUNTU_DIR)/ubuntu naligun/mirros/ubuntu;\
- rm -rf nailgun/mirrors$(UBUNTU_DIR);\
+ # On the end we want to have ubuntu repository in mirrors/ubuntu directory
+ -if [ "$(MIRROR_UBUNTU_ROOT)" != "/ubuntu/" ]; then \
+ mkdir -p nailgun/mirrors/ubuntu;\
+ mv nailgun/mirrors$(MIRROR_UBUNTU_ROOT)* nailgun/mirrors/ubuntu;\
+ [ "$(MIRROR_UBUNTU_ROOT)" != "/" ] && rm -rf nailgun/mirrors/$(TMP_ROOT_DIR);\
fi
# Store artifact in cache straight away if caching is enabled
# (no .cacheid will be present unless this is a cached build)
.PHONY: clean
clean:
- @rm -rf ../release/opnfv/nailgun nailgun fuel-mirror
+ @rm -rf ../release/opnfv/nailgun nailgun fuel-mirror opnfv-config.yaml ubuntu.yaml
.PHONY: release
release:nailgun