You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by wo...@apache.org on 2017/07/27 05:46:38 UTC
[couchdb-pkg] branch master updated: Add script to build all
packages for a release
This is an automated email from the ASF dual-hosted git repository.
wohali pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb-pkg.git
The following commit(s) were added to refs/heads/master by this push:
new e6a707c Add script to build all packages for a release
e6a707c is described below
commit e6a707c77b11d93dbd0fe857c242a267c9cc9c9c
Author: Joan Touzet <wo...@apache.org>
AuthorDate: Wed Jul 26 22:46:27 2017 -0700
Add script to build all packages for a release
---
.gitignore | 2 ++
Makefile | 16 ++++++++++++++++
README.md | 26 ++++++++++++++++++++++++++
make-releases.sh | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 101 insertions(+)
diff --git a/.gitignore b/.gitignore
index c4c095f..23c2c82 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,5 @@ rpm/SRPMS
repo/db
repo/dists
repo/pool
+pkgs/
+couchdb/
diff --git a/Makefile b/Makefile
index 554925a..8724e07 100644
--- a/Makefile
+++ b/Makefile
@@ -58,6 +58,15 @@ get-couch:
mkdir -p $(COUCHDIR)
git clone https://github.com/apache/couchdb
+download-couch:
+ mkdir -p $(COUCHDIR)
+ cd $(COUCHDIR) && curl -O $(URL) && tar xfz *.tar.gz
+
+copy-couch:
+ mkdir -p $(COUCHDIR)
+ cp $(COUCHTARBALL) $(COUCHDIR)
+ cd $(COUCHDIR) && tar xfz *.tar.gz
+
build-couch:
cd $(COUCHDIR) && make dist
@@ -107,3 +116,10 @@ install-js185:
rm-js185-rpms:
rm -f ../rpmbuild/RPMS/x86_64/js*
+
+# ######################################
+copy-pkgs:
+ mkdir -p pkgs/$(PLATFORM)
+ -cp ../rpmbuild/RPMS/x86_64/*.rpm pkgs/$(PLATFORM)
+ -cp ../couchdb/*deb pkgs/$(PLATFORM)
+ -chmod -R a+rwx pkgs/$(PLATFORM)
diff --git a/README.md b/README.md
index e7c1c4a..863dd2e 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,32 @@ $ cd .. && git clone https://github.com/apache/couchdb
$ cd couchdb-pkg && make build-couch $(lsb_release -cs) PLATFORM=$(lsb_release -cs)
```
+# Building packages for a release
+
+## Prerequisites
+
+1. Linux running Docker
+1. The current user must be capable of running `docker run`.
+1. Enough free disk space to download all of the Docker images + build
+ CouchDB.
+
+## Running the package build
+
+You can either build packages from a local CouchDB dist tarball (the output
+of `make dist`), or from a URL of a published CouchDB dist tarball (such
+as the ones on https://couchdb.apache.org/). The package's version number
+will be derived from the filename of the CouchDB dist tarball.
+
+Run:
+
+ $ ./make-packages path/to/apache-couchdb-VERSION.tar.gz
+
+or
+
+ $ ./make-pacakges http://url/to/apache-couchdb-VERSION.tar.gz
+
+Packages will be placed in the `pkgs/` subdirectory.
+
# Feedback, Issues, Contributing
General feedback is welcome at our [user][1] or [developer][2] mailing lists.
diff --git a/make-releases.sh b/make-releases.sh
new file mode 100755
index 0000000..e61780a
--- /dev/null
+++ b/make-releases.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+IMAGES=(
+ centos-6-erlang-18.3 centos6 \
+ centos-7-erlang-18.3 centos7 \
+ debian-8-erlang-18.3 jessie \
+ ubuntu-14.04-erlang-18.3 trusty \
+ ubuntu-16.04-erlang-18.3 xenial
+)
+
+usage() {
+ echo $0 takes exactly one argument, either:
+ echo ' - path/to/couchdb-VERSION.tar.gz or'
+ echo ' - http://url/to/couchdb-VERSION.tar.gz'
+ echo
+ exit
+}
+
+if [ $# -ne "1" ]
+then
+ usage
+fi
+
+ARG=$1
+
+if [ -f ${ARG} ]
+then
+ # file
+ cp ${ARG} . 2>/dev/null || true
+ FILE=$(basename ${ARG})
+else
+ if [[ ${ARG} =~ ^http.*$ ]]
+ then
+ # url
+ # thank you, advanced bash scripting guide
+ curl -O ${ARG}
+ FILE=${ARG##*/}
+ else
+ usage
+ fi
+fi
+
+echo Using ${FILE} to build packages...
+chmod 777 ${FILE}
+
+mkdir -p pkgs && chmod 777 pkgs
+
+image_count=${#IMAGES[@]}
+index=0
+
+while [ "$index" -lt "$image_count" ]
+do
+ img=${IMAGES[$index]}
+ ((index++))
+ plat=${IMAGES[$index]}
+ ((index++))
+ docker run -it -w /tmp/couchdb-pkg -v $(readlink -f .):/tmp/couchdb-pkg couchdbdev/$img make copy-couch $plat copy-pkgs PLATFORM=$plat COUCHTARBALL=${FILE}
+done
--
To stop receiving notification emails like this one, please contact
['"commits@couchdb.apache.org" <co...@couchdb.apache.org>'].