Skip to content

Improve release script instructions #4236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions dev/release/000-run-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ fi
docker build -t "${IMAGE_NAME}-${USER_NAME}" - <<UserSpecificDocker
FROM --platform=linux/amd64 ${IMAGE_NAME}
RUN groupadd --non-unique -g ${GROUP_ID} ${USER_NAME} && \
useradd -l -g ${GROUP_ID} -u ${USER_ID} -k /root -m ${USER_NAME}
useradd -l -g ${GROUP_ID} -u ${USER_ID} -k /root -m ${USER_NAME} && \
mkdir -p /gpg && chown ${USER_ID}:${GROUP_ID} /gpg && chmod 700 /gpg
ENV HOME /home/${USER_NAME}
UserSpecificDocker

Expand All @@ -72,7 +73,13 @@ RC_DIR="bookkeeper-${VERSION}-rc${RC_NUM}"
RC_TAG="v${VERSION}-rc${RC_NUM}"

CMD="
gpg-agent --daemon --pinentry-program /usr/bin/pinentry --homedir \$HOME/.gnupg --use-standard-socket
# copy ~/.gnupg to /gpg in the container to workaround issue with permissions
cp -Rdp \$HOME/.gnupg /gpg
# remove any previous sockets
rm -rf /gpg/.gnupg/S.*
# set GNUPGHOME to /gpg/.gnupg
export GNUPGHOME=/gpg/.gnupg
gpg-agent --daemon --pinentry-program /usr/bin/pinentry --allow-loopback-pinentry --default-cache-ttl 3600
echo
echo 'Welcome to Apache BookKeeper Release Build Env'
echo
Expand All @@ -92,9 +99,20 @@ echo 'RC_TAG = $RC_TAG'
echo
echo 'Before executing any release scripts, PLEASE configure your git to cache your github password:'
echo
echo ' // take a backup of ~/.gitconfig, remember to restore it after the release process'
echo ' \$ cp ~/.gitconfig ~/.gitconfig.bak.\$(date -I)'
echo ' // remove any previous credential helper configuration'
echo ' \$ git config --global -l --name-only | grep credential | uniq | xargs -i{} git config --global --unset-all {}'
echo ' // fix permission warning with git in docker on MacOS'
echo ' \$ git config --global safe.directory $PWD'
echo ' // configure credential helper to cache your github password for 1 hr during the whole release process '
echo ' \$ git config --global credential.helper \"cache --timeout=3600\" '
echo ' \$ git push apache --dry-run '
echo ' // in another terminal get a GitHub token to be used as a password for the release process, assuming you are using GitHub CLI.'
echo ' \$ gh auth token '
echo ' // attempt to push to apache remote to cache your password'
echo ' \$ git push apache HEAD:test --dry-run '
echo ' // cache gpg password by signing a dummy file'
echo ' \$ echo dummy > /tmp/dummy && gpg -sa /tmp/dummy'
echo
bash
"
Expand Down
2 changes: 1 addition & 1 deletion dev/release/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
FROM --platform=linux/amd64 maven:3.9.0-eclipse-temurin-8

RUN apt-get update
RUN apt-get install -y g++ cmake gnupg2 vim subversion
RUN apt-get install -y g++ cmake gnupg2 vim subversion less
Loading