You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by iv...@apache.org on 2019/04/01 12:19:55 UTC

[bookkeeper] branch master updated: Docker autobuild hook

This is an automated email from the ASF dual-hosted git repository.

ivank pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new 4573285  Docker autobuild hook
4573285 is described below

commit 4573285db9e027416bf33ab9b959b952d2b0e8d5
Author: Ivan Kelly <iv...@apache.org>
AuthorDate: Mon Apr 1 14:19:49 2019 +0200

    Docker autobuild hook
    
    This hook will allow docker autobuild to build from the offical tag
    and removes the need to update the dockerfile after the release has
    been made.
    
    It also adds a build arg, DISTRO_URL which can be used for testing
    release candidates.
    
    ```
    docker build --build-arg BK_VERSION=4.9.1
        --build-arg DISTRO_URL=<rc-tarball-url> .
    ```
    
    
    Reviewers: Enrico Olivelli <eo...@gmail.com>, Sijie Guo <si...@apache.org>
    
    This closes #2017 from ivankelly/docker-tag2
---
 docker/Dockerfile               | 12 ++++++------
 docker/hooks/build              |  3 +++
 site/community/release_guide.md | 39 ++++++++++++++++-----------------------
 3 files changed, 25 insertions(+), 29 deletions(-)

diff --git a/docker/Dockerfile b/docker/Dockerfile
index d8639d8..ff1396b 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -22,7 +22,7 @@ MAINTAINER Apache BookKeeper <de...@bookkeeper.apache.org>
 
 ARG BK_VERSION=4.9.0
 ARG DISTRO_NAME=bookkeeper-server-${BK_VERSION}-bin
-ARG GPG_KEY=FD74402C
+ARG DISTRO_URL=https://archive.apache.org/dist/bookkeeper/bookkeeper-${BK_VERSION}/${DISTRO_NAME}.tar.gz
 
 ENV BOOKIE_PORT=3181
 EXPOSE $BOOKIE_PORT
@@ -30,18 +30,18 @@ ENV BK_USER=bookkeeper
 ENV BK_HOME=/opt/bookkeeper
 ENV JAVA_HOME=/usr/lib/jvm/jre-1.8.0
 
-
 # Download Apache Bookkeeper, untar and clean up
 RUN set -x \
     && adduser "${BK_USER}" \
     && yum install -y java-1.8.0-openjdk-headless wget bash python sudo \
     && mkdir -pv /opt \
     && cd /opt \
-    && wget -q "https://archive.apache.org/dist/bookkeeper/bookkeeper-${BK_VERSION}/${DISTRO_NAME}.tar.gz" \
-    && wget -q "https://archive.apache.org/dist/bookkeeper/bookkeeper-${BK_VERSION}/${DISTRO_NAME}.tar.gz.asc" \
-    && wget -q "https://archive.apache.org/dist/bookkeeper/bookkeeper-${BK_VERSION}/${DISTRO_NAME}.tar.gz.sha512" \
+    && wget -q "${DISTRO_URL}" \
+    && wget -q "${DISTRO_URL}.asc" \
+    && wget -q "${DISTRO_URL}.sha512" \
     && sha512sum -c ${DISTRO_NAME}.tar.gz.sha512 \
-    && gpg --keyserver ha.pool.sks-keyservers.net --recv-key "$GPG_KEY" \
+    && wget https://dist.apache.org/repos/dist/release/bookkeeper/KEYS \
+    && gpg --import KEYS \
     && gpg --batch --verify "$DISTRO_NAME.tar.gz.asc" "$DISTRO_NAME.tar.gz" \
     && tar -xzf "$DISTRO_NAME.tar.gz" \
     && mv bookkeeper-server-${BK_VERSION}/ /opt/bookkeeper/ \
diff --git a/docker/hooks/build b/docker/hooks/build
new file mode 100755
index 0000000..3c479e2
--- /dev/null
+++ b/docker/hooks/build
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+docker build --build-arg BK_VERSION=$DOCKER_TAG -t $IMAGE_NAME .
\ No newline at end of file
diff --git a/site/community/release_guide.md b/site/community/release_guide.md
index c8a05a3..ef2ef09 100644
--- a/site/community/release_guide.md
+++ b/site/community/release_guide.md
@@ -472,14 +472,25 @@ Copy the source release from the `dev` repository to the `release` repository at
 
 2. Merge the Release Notes pull request and make sure the Release Notes is updated.
 
-### Update Dockerfile
+### Git tag
 
-> NOTE: The dockerfile PR should only be merged after the release package is showed up under https://archive.apache.org/dist/bookkeeper/
+> NOTE: Only create the release tag after the release package is showed up under https://archive.apache.org/dist/bookkeeper/ as creating the tag triggers a docker autobuild which needs the package to exist. If you forget to do so, the build will fail. In this case you can delete the tag from github and push it again.
 
-1. Update the `BK_VERSION` and `GPG_KEY` in `docker/Dockerfile` (e.g. [Pull Request 436](https://github.com/apache/bookkeeper/pull/436) ),
-    send a pull request for review and get an approval from the community.
+Create and push a new signed for the released version by copying the tag for the final release tag, as follows
 
-2. Once the pull request is approved, merge this pull request into master and make sure it is cherry-picked into corresponding branch.
+```shell
+git tag -s "${TAG}" "${RC_TAG}"
+git push apache "${TAG}"
+```
+
+Remove rc tags:
+
+```shell
+for num in $(seq 0 ${RC_NUM}); do
+    git tag -d "v${VERSION}-rc${num}"
+    git push apache :"v${VERSION}-rc${num}"
+done
+```
 
 ### Update DC/OS BookKeeper package
 
@@ -548,24 +559,6 @@ It is easy if only version need be bump.
     $ git commit -m "new bookkeeper version"
     ```
 
-### Git tag
-
-Create and push a new signed for the released version by copying the tag for the final release tag, as follows
-
-```shell
-git tag -s "${TAG}" "${RC_TAG}"
-git push apache "${TAG}"
-```
-
-Remove rc tags:
-
-```shell
-for num in $(seq 0 ${RC_NUM}); do
-    git tag -d "v${VERSION}-rc${num}"
-    git push apache :"v${VERSION}-rc${num}"
-done
-```
-
 ### Verify Docker Image
 
 > After release tag is created, it will automatically trigger docker auto build.