Also add recent RPM/.deb build_vars.yaml sections.
Change-Id: I7dc501d552d8e345c70612b88ab534e54dd81dc2
Signed-off-by: Michal Skalski <mskalski@mirantis.com>
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
--- /dev/null
+opendaylight
+cache
--- /dev/null
+*.deb
+*.tar.gz
--- /dev/null
+# Dockerfile
+FROM debian:jessie-backports
+
+ENV DEBIAN_FRONTEND noninteractive
+RUN apt-get update && apt-get install -y \
+ build-essential \
+ sudo \
+ devscripts \
+ equivs \
+ dh-systemd \
+ python-yaml \
+ python-jinja2
+RUN mkdir -p /build
+ENTRYPOINT ["/build/build.py"]
+CMD ["-h"]
#### Table of Contents
1. [Overview](#overview)
1. [Vagrant Build Environment](#vagrant-build-environment)
+ * [Docker provider](#docker-provider)
1. [Building Debs](#building-debs)
1. [Defining New Debs](#defining-new-debs)
* [Deb Build Variables](#deb-build-variables)
## Vagrant Build Environment
-Deb builds can be done in the included Vagrantfile. It provides a
-consistent, known-working and easily shared environment.
+The included Vagrantfile defines a consistent, known-working and easily
+shared environment. It supports both VM and container-based providers.
[~/packaging/deb]$ vagrant status
Current machine states:
[vagrant@localhost ~]$ ls /vagrant/
opendaylight README.markdown Vagrantfile
+### Docker provider
+
+The Vagrantfile defines a Docker provider, enabling easy access to build.py
+in a container. The general command format is:
+
+```
+$ vagrant docker-run -- <flags to build.py>
+```
+
+To pass 5.0 (Boron) as the version to build:
+
+```
+$ vagrant docker-run -- -v 5 0
+```
+
+Dockerfile can be also used directly to build container image:
+
+```
+$ docker build -t "odl_deb" .
+$ docker run -v $(pwd):/build odl_deb -v 5 0
+```
+
## Building Debs
The `build.py` helper script is used for building OpenDaylight .debs.
following the instructions given [here][2].
[1]: https://build.opensuse.org/
-[2]: http://software.opensuse.org/download.html?project=home%3Aakshitajha&package=opendaylight
\ No newline at end of file
+[2]: http://software.opensuse.org/download.html?project=home%3Aakshitajha&package=opendaylight
# -*- mode: ruby -*-
# vi: set ft=ruby :
+BOX = "debian/jessie64"
+BOX_VERSION = "= 8.5.2"
+
Vagrant.configure("2") do |config|
# Configure VM RAM and CPU for VirtualBox
- config.vm.provider :virtualbox do |virtualbox|
+ config.vm.provider :virtualbox do |virtualbox, override|
virtualbox.memory = 1024
# Two cores over default one for faster builds
virtualbox.cpus = 2
+ override.vm.box = BOX
+ override.vm.box_version = BOX_VERSION
end
# Configure VM RAM and CPU for LibVirt
- config.vm.provider :libvirt do |libvirt|
+ config.vm.provider :libvirt do |libvirt, override|
libvirt.memory = 1024
# Two cores over default one for faster builds
libvirt.cpus = 2
+ override.vm.box = BOX
+ override.vm.box_version = BOX_VERSION
+ end
+
+ config.vm.provider "docker" do |docker, override|
+ docker.build_dir = "."
+ docker.remains_running = false
+ override.vm.synced_folder ".", "/build"
end
# NFS is fragile, disable it and use rsync
# Sync folders /packaging/deb/ and /vagrant
config.vm.synced_folder ".", "/vagrant"
- # Start from Debian VM so resulting pkgs will build on all Deb derivatives
- config.vm.box = "debian/jessie64"
- config.vm.box_version = "= 8.5.2"
-
# Update package info to prevent old info from causing 404s during install
config.vm.provision "shell", inline: "apt-get update"
pkg_version: "1"
sysd_commit: 07f7c83b0ef46ad3809e5be03e09a77fe554eeae
codename: Beryllium-SR3
- download_url: "https://nexus.opendaylight.org/content/repositories/autorelease-1367/org/opendaylight/integration/distribution-karaf/0.4.3-Beryllium-SR3/distribution-karaf-0.4.3-Beryllium-SR3.tar.gz"
+ download_url: "https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.4.3-Beryllium-SR3/distribution-karaf-0.4.3-Beryllium-SR3.tar.gz"
java_version: "7"
changelog_date: "Tue, 26 Jul 2016"
changelog_time: "17:48:42 +0530"
changelog_name: "Daniel Farrell"
changelog_email: "dfarrell@redhat.com"
+ - version_major: "4"
+ version_minor: "4"
+ version_patch: "0"
+ pkg_version: "1"
+ sysd_commit: 07f7c83b0ef46ad3809e5be03e09a77fe554eeae
+ codename: Beryllium-SR4
+ download_url: "https://nexus.opendaylight.org/content/repositories/public/org/opendaylight/integration/distribution-karaf/0.4.4-Beryllium-SR4/distribution-karaf-0.4.4-Beryllium-SR4.tar.gz"
+ java_version: "7"
+ changelog_date: "Wed, 16 Nov 2016"
+ changelog_time: "01:40:00 +0100"
+ changelog_name: "Michal Skalski"
+ changelog_email: "mskalski@mirantis.com"
- version_major: "5"
version_minor: "0"
version_patch: "0"
pkg_version: "1"
- codename: SNAPSHOT
- download_url: "https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/integration/distribution-karaf/0.5.0-SNAPSHOT/distribution-karaf-0.5.0-20160809.145534-4240.tar.gz"
+ codename: Boron
+ download_url: "https://nexus.opendaylight.org/content/repositories/public/org/opendaylight/integration/distribution-karaf/0.5.0-Boron/distribution-karaf-0.5.0-Boron.tar.gz"
sysd_commit: 07f7c83b0ef46ad3809e5be03e09a77fe554eeae
java_version: "8"
- changelog_date: "Tue, 09 Aug 2016"
- changelog_time: "17:48:42 +0530"
- changelog_name: "Daniel Farrell"
- changelog_email: "dfarrell@redhat.com"
+ changelog_date: "Wed, 16 Nov 2016"
+ changelog_time: "01:40:00 +0100"
+ changelog_name: "Michal Skalski"
+ changelog_email: "mskalski@mirantis.com"
+ - version_major: "5"
+ version_minor: "1"
+ version_patch: "0"
+ pkg_version: "1"
+ codename: Boron-SR1
+ download_url: "https://nexus.opendaylight.org/content/repositories/public/org/opendaylight/integration/distribution-karaf/0.5.1-Boron-SR1/distribution-karaf-0.5.1-Boron-SR1.tar.gz"
+ sysd_commit: 07f7c83b0ef46ad3809e5be03e09a77fe554eeae
+ java_version: "8"
+ changelog_date: "Wed, 16 Nov 2016"
+ changelog_time: "01:40:00 +0100"
+ changelog_name: "Michal Skalski"
+ changelog_email: "mskalski@mirantis.com"
--- /dev/null
+FROM centos:centos7
+
+RUN yum -y update && yum -y install epel-release
+RUN yum -y install fedora-packager \
+ python-pip \
+ && yum clean all
+COPY requirements.txt /tmp/requirements.txt
+RUN pip install --upgrade pip && pip install -r /tmp/requirements.txt
+RUN useradd builder
+RUN usermod -a -G mock builder
+RUN mkdir -p /build
+USER builder
+ENTRYPOINT ["/build/build.py"]
+CMD ["-h"]
## Vagrant Build Environment
-All SRPM builds are done in the included Vagrantfile. It provides a
-consistent, known-working and easily shared environment.
+The included Vagrantfile defines a consistent, known-working and easily
+shared environment. It supports both VM and container-based providers.
```
-[~/packaging/rpm]$ vagrant status
+$ vagrant status
Current machine states:
default not created (virtualbox)
-[~/packaging/rpm]$ vagrant up
-[~/packaging/rpm]$ vagrant ssh
+$ vagrant up
+$ vagrant ssh
[vagrant@localhost vagrant]$ ls /vagrant/
build.py build_vars.yaml cache connect.sh Vagrantfile <snip>
```
+### Docker provider
+
+The Vagrantfile defines a Docker provider, enabling easy access to build.py
+in a container. The general command format is:
+
+```
+$ vagrant docker-run -- <flags to build.py>
+```
+
+To pass 5.0 (Boron) as the version to build:
+
+```
+$ vagrant docker-run -- -v 5 0
+```
+
+Dockerfile can be also used directly to build container image:
+
+```
+$ docker build -t "odl_rpm" .
+$ docker run -v $(pwd):/build odl_rpm -v 5 0
+```
+
## Defining New RPMs
The dynamic aspects of a build, such as ODL and RPM version info, have all
# Vagrantfile API/syntax version.
VAGRANTFILE_API_VERSION = "2"
+BOX = "centos/7"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
- # RPM build environment is CentOS 7
- config.vm.box = "centos/7"
-
# Configure VM RAM and CPU for VirtualBox. Change this to meet your needs.
- config.vm.provider :virtualbox do |virtualbox|
+ config.vm.provider :virtualbox do |virtualbox, override|
virtualbox.memory = 2048
virtualbox.cpus = 2
+ override.vm.box = BOX
end
# Configure VM RAM and CPU for LibVirt. Change this to meet your needs.
- config.vm.provider :libvirt do |libvirt|
+ config.vm.provider :libvirt do |libvirt, override|
libvirt.memory = 2048
libvirt.cpus = 2
+ override.vm.box = BOX
+ end
+
+ config.vm.provider "docker" do |docker, override|
+ docker.build_dir = "."
+ docker.remains_running = false
+ override.vm.synced_folder ".", "/build"
end
# NFS is fragile, use rsync
changelog_date: "Thu Oct 27 2016"
changelog_name: "Daniel Farrell"
changelog_email: "dfarrell@redhat.com"
+ - version_major: "5"
+ version_minor: "1"
+ version_patch: "0"
+ rpm_release: "1"
+ codename: Boron-SR1
+ download_url: "https://nexus.opendaylight.org/content/repositories/public/org/opendaylight/integration/distribution-karaf/0.5.1-Boron-SR1/distribution-karaf-0.5.1-Boron-SR1.tar.gz"
+ sysd_commit: 07f7c83b0ef46ad3809e5be03e09a77fe554eeae
+ changelog_date: "Wed Nov 16 2016"
+ changelog_name: "Michal Skalski"
+ changelog_email: "mskalski@mirantis.com"