1 Entrance script is _do-release-docker.sh_. Requires a local docker;
2 for example, on mac os x, Docker for Desktop installed and running.
6 $ ./do-release-docker.sh -h
8 To run a build w/o invoking docker (not recommended!), use _do_release.sh_.
10 Both scripts will query interactively for needed parameters and passphrases.
11 For explanation of the parameters, execute:
12 $ release-build.sh --help
14 Before starting the RC build, run a reconciliation of what is in
15 JIRA with what is in the commit log. Make sure they align and that
16 anomalies are explained up in JIRA.
18 See http://hbase.apache.org/book.html#maven.release
20 Regardless of where your release build will run (locally, locally in docker, on a remote machine,
21 etc) you will need a local gpg-agent with access to your secret keys. A quick way to tell gpg
22 to clear out state and start a gpg-agent is via the following command phrase:
24 $ gpgconf --kill all && gpg-connect-agent /bye
26 Before starting an RC build, make sure your local gpg-agent has configs
27 to properly handle your credentials, especially if you want to avoid
28 typing the passphrase to your secret key.
30 e.g. if you are going to run and step away, best to increase the TTL
31 on caching the unlocked secret via ~/.gnupg/gpg-agent.conf
32 # in seconds, e.g. a day
33 default-cache-ttl 86400
36 Running a build on GCE is easy enough. Here are some notes if of use.
37 Create an instance. 4CPU/15G/10G disk seems to work well enough.
38 Once up, run the below to make your machine fit for RC building:
40 # Presuming debian-compatible OS, do these steps on the VM
41 # your VM username should be your ASF id, because it will show up in build artifacts.
42 # Follow the docker install guide: https://docs.docker.com/engine/install/debian/
43 $ sudo apt-get install -y \
48 software-properties-common
49 $ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
50 $ sudo add-apt-repository -y \
51 "deb [arch=amd64] https://download.docker.com/linux/debian \
55 $ sudo apt-get install -y docker-ce docker-ce-cli containerd.io
56 # Follow the post installation steps: https://docs.docker.com/engine/install/linux-postinstall/
57 $ sudo usermod -aG docker $USER
58 # LOGOUT and then LOGIN again so $USERID shows as part of docker group
59 # Test here by running docker's hello world as your build user
60 $ docker run hello-world
62 # Follow the GPG guide for forwarding your gpg-agent from your local machine to the VM
63 # https://wiki.gnupg.org/AgentForwarding
64 # On the VM find out the location of the gpg agent socket and extra socket
65 $ gpgconf --list-dir agent-socket
66 /run/user/1000/gnupg/S.gpg-agent
67 $ gpgconf --list-dir agent-extra-socket
68 /run/user/1000/gnupg/S.gpg-agent.extra
69 # On the VM configure sshd to remove stale sockets
70 $ sudo bash -c 'echo "StreamLocalBindUnlink yes" >> /etc/ssh/sshd_config'
71 $ sudo systemctl restart ssh
74 # Do these steps on your local machine.
75 # make sure gpg-agent is running
76 $ gpg-connect-agent /bye
77 # Export your public key and copy it to the VM.
78 # Assuming 'example.gce.host' maps to your VM's external IP (or use the IP)
79 $ gpg --export example@apache.org > ~/gpg.example.apache.pub
80 $ scp ~/gpg.example.apache.pub example.gce.host:
81 # ssh into the VM while forwarding the remote gpg socket locations found above to your local
82 # gpg-agent's extra socket (this will restrict what commands the remote node is allowed to have
83 # your agent handle. Note that the gpg guide above can help you set this up in your ssh config
84 # rather than typing it in ssh like this every time.
85 $ ssh -i ~/.ssh/my_id \
86 -R "/run/user/1000/gnupg/S.gpg-agent:$(gpgconf --list-dir agent-extra-socket)" \
87 -R "/run/user/1000/gnupg/S.gpg-agent.extra:$(gpgconf --list-dir agent-extra-socket)" \
90 # now in an SSH session on the VM with the socket forwarding
91 # import your public key and test signing with the forwarding to your local agent.
92 $ gpg --no-autostart --import gpg.example.apache.pub
93 $ echo "foo" > foo.txt
94 $ gpg --no-autostart --detach --armor --sign foo.txt
95 $ gpg --no-autostart --verify foo.txt.asc
97 # install git and clone the main project on the build machine
98 $ sudo apt-get install -y git
99 $ git clone https://github.com/apache/hbase.git
100 # finally set up an output folder and launch a dry run.
103 $ ./dev-support/create-release/do-release-docker.sh -d ~/build
105 # for building the main repo specifically you can save an extra download by pointing the build
106 # to the local clone you just made
107 $ ./dev-support/create-release/do-release-docker.sh -d ~/build -r .git