Skip to content

Commit

Permalink
Use git author for Debian changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
romcheg committed May 24, 2019
1 parent 6c01721 commit 248c35e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
11 changes: 8 additions & 3 deletions Makefile
Expand Up @@ -9,7 +9,12 @@ DOCKER_REPO_NAME?="allegro"
# commits it and tags the created commit with the appropriate snapshot version.
release-new-version: new_version = $(shell ./get_version.sh generate)
release-new-version:
docker build --force-rm -f docker/Dockerfile-deb -t ralph-deb .
docker build \
--force-rm \
-f docker/Dockerfile-deb \
--build-arg GIT_USER_NAME="$(shell git config user.name)" \
--build-arg GIT_USER_EMAIL="$(shell git config user.email)" \
-t ralph-deb:latest .
docker run --rm -it -v $(shell pwd):/volume ralph-deb:latest release-new-version
docker image rm --force ralph-deb:latest
git add debian/changelog
Expand All @@ -19,14 +24,14 @@ release-new-version:
# build-package builds a release version of the package using the generated
# changelog and the tag.
build-package:
docker build --force-rm -f docker/Dockerfile-deb -t ralph-deb .
docker build --force-rm -f docker/Dockerfile-deb -t ralph-deb:latest .
docker run --rm -v $(shell pwd):/volume ralph-deb:latest build-package
docker image rm --force ralph-deb:latest

# build-snapshot-package renerates a snapshot changelog and uses it to build
# snapshot version of the package. It is mainly used for testing.
build-snapshot-package:
docker build --force-rm -f docker/Dockerfile-deb -t ralph-deb .
docker build --force-rm -f docker/Dockerfile-deb -t ralph-deb:latest .
docker run --rm -v $(shell pwd):/volume ralph-deb:latest build-snapshot-package
docker image rm --force ralph-deb:latest

Expand Down
8 changes: 7 additions & 1 deletion docker/Dockerfile-deb
Expand Up @@ -4,6 +4,9 @@ LABEL maintainer="Allegro.pl Sp. z o.o. opensource@allegro.pl"
LABEL authors="Allegro.pl Sp. z o.o. and Contributors opensource@allegro.pl"
LABEL description="Helper image to build deb package for Ralph."

ARG GIT_USER_NAME='root'
ARG GIT_USER_EMAIL='root@localhost'

ENV DEBIAN_FRONTEND=noninteractive
ENV SHELL=/bin/bash
ENV TERM=xterm
Expand All @@ -13,7 +16,10 @@ ENV RALPH_DIR=/opt/ralph
RUN apt-get update && \
apt-get -y install build-essential debhelper devscripts equivs dh-virtualenv \
git libmysqlclient-dev python3 python3-dev libffi-dev nodejs npm git-buildpackage \
vim-tiny
vim-tiny && \
rm -rf /var/lib/apt/lists/* && \
git config --global user.name "$GIT_USER_NAME" && \
git config --global user.email "$GIT_USER_EMAIL"

COPY . $RALPH_DIR

Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_deb_changelog.sh
Expand Up @@ -18,4 +18,4 @@ else
fi

echo ${VERSION}
gbp dch --ignore-branch --spawn-editor=release --new-version "${VERSION}" ${VERSION_PARAMS}
gbp dch --ignore-branch --git-author --spawn-editor=release --new-version "${VERSION}" ${VERSION_PARAMS}

0 comments on commit 248c35e

Please sign in to comment.