Skip to content

Commit feae0b1

Browse files
committed
Improve release script instructions (#4236)
(cherry picked from commit 222f42a)
1 parent 32ad52e commit feae0b1

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

dev/release/000-run-docker.sh

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ fi
5050
docker build -t "${IMAGE_NAME}-${USER_NAME}" - <<UserSpecificDocker
5151
FROM --platform=linux/amd64 ${IMAGE_NAME}
5252
RUN groupadd --non-unique -g ${GROUP_ID} ${USER_NAME} && \
53-
useradd -l -g ${GROUP_ID} -u ${USER_ID} -k /root -m ${USER_NAME}
53+
useradd -l -g ${GROUP_ID} -u ${USER_ID} -k /root -m ${USER_NAME} && \
54+
([ "$(dirname "$HOME")" -eq "/home" ] || ln -s /home $(dirname "$HOME")) && \
55+
mkdir -p /gpg && chown ${USER_ID}:${GROUP_ID} /gpg && chmod 700 /gpg
5456
ENV HOME /home/${USER_NAME}
5557
UserSpecificDocker
5658

@@ -72,7 +74,13 @@ RC_DIR="bookkeeper-${VERSION}-rc${RC_NUM}"
7274
RC_TAG="v${VERSION}-rc${RC_NUM}"
7375

7476
CMD="
75-
gpg-agent --daemon --pinentry-program /usr/bin/pinentry --homedir \$HOME/.gnupg --use-standard-socket
77+
# copy ~/.gnupg to /gpg in the container to workaround issue with permissions
78+
cp -Rdp \$HOME/.gnupg /gpg
79+
# remove any previous sockets
80+
rm -rf /gpg/.gnupg/S.*
81+
# set GNUPGHOME to /gpg/.gnupg
82+
export GNUPGHOME=/gpg/.gnupg
83+
gpg-agent --daemon --pinentry-program /usr/bin/pinentry --allow-loopback-pinentry --default-cache-ttl 3600
7684
echo
7785
echo 'Welcome to Apache BookKeeper Release Build Env'
7886
echo
@@ -92,9 +100,21 @@ echo 'RC_TAG = $RC_TAG'
92100
echo
93101
echo 'Before executing any release scripts, PLEASE configure your git to cache your github password:'
94102
echo
103+
echo ' // take a backup of ~/.gitconfig, remember to restore it after the release process'
104+
echo ' \$ cp ~/.gitconfig ~/.gitconfig.bak.\$(date -I)'
105+
echo ' // remove any previous credential helper configuration'
106+
echo ' \$ git config --global -l --name-only | grep credential | uniq | xargs -i{} git config --global --unset-all {}'
107+
echo ' // fix permission warning with git in docker on MacOS'
108+
echo ' \$ git config --global --add safe.directory $PWD'
109+
echo ' \$ git config --global --add safe.directory \$PWD'
95110
echo ' // configure credential helper to cache your github password for 1 hr during the whole release process '
96111
echo ' \$ git config --global credential.helper \"cache --timeout=3600\" '
97-
echo ' \$ git push apache --dry-run '
112+
echo ' // in another terminal get a GitHub token to be used as a password for the release process, assuming you are using GitHub CLI.'
113+
echo ' \$ gh auth token '
114+
echo ' // attempt to push to apache remote to cache your password'
115+
echo ' \$ git push apache HEAD:test --dry-run '
116+
echo ' // cache gpg password by signing a dummy file'
117+
echo ' \$ echo dummy > /tmp/dummy && gpg -sa /tmp/dummy'
98118
echo
99119
bash
100120
"

dev/release/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#
1919

2020
FROM --platform=linux/amd64 maven:3.9.0-eclipse-temurin-8
21+
ARG DEBIAN_FRONTEND=noninteractive
22+
RUN apt-get update && \
23+
apt-get dist-upgrade -y && \
24+
apt-get install -y g++ cmake gnupg2 vim subversion less zip unzip
2125

22-
RUN apt-get update
23-
RUN apt-get install -y g++ cmake gnupg2 vim subversion

0 commit comments

Comments
 (0)