Skip to content

Commit 8ba6522

Browse files
rustyrussellShahanaFarooqui
authored andcommitted
tools/build-release.sh: don't assume you need sudo to run docker.
I don't! Signed-off-by: Rusty Russell <[email protected]>
1 parent b0a9b55 commit 8ba6522

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

doc/contribute-to-core-lightning/release-checklist.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ Here's a checklist for the release process.
6464
- `git pull`
6565
- `git tag -a -s v${VERSION} -m v${VERSION}`
6666
- `git push --tags`
67-
5. Run `tools/build-release.sh` to:
67+
5. Run `tools/build-release.sh` (with `--sudo` if you need root to run Docker) to:
6868
- Create reproducible zipfile
6969
- Build non-reproducible Fedora image
70-
- Build reproducible Ubuntu-v18.04, Ubuntu-v20.04, Ubuntu-v22.04 images. Follow [link](https://docs.corelightning.org/docs/repro#building-using-the-builder-image) for manually Building Ubuntu Images.
70+
- Build reproducible Ubuntu-v20.04, Ubuntu-v22.04 and Ubuntu-v24.04 images. Follow [link](https://docs.corelightning.org/docs/repro#building-using-the-builder-image) for manually Building Ubuntu Images.
7171
- Build Docker images for amd64 and arm64v8. Follow [link](https://docs.corelightning.org/docs/docker-images) for more details on Docker publishing.
7272
- Create and sign checksums. Follow [link](https://docs.corelightning.org/docs/repro#co-signing-the-release-manifest) for manually signing the release.
73-
6. The tarballs may be owned by root, so revert ownership if necessary:
73+
6. If you used `--sudo`, the tarballs may be owned by root, so revert ownership if necessary:
7474
`sudo chown ${USER}:${USER} *${VERSION}*`
7575
7. Upload the resulting files to github and save as a draft.
7676
(<https://github.com/ElementsProject/lightning/releases/>)

tools/build-release.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ fi
2626
FORCE_UNCLEAN=false
2727
VERIFY_RELEASE=false
2828
WITHOUT_ZIP=false
29+
SUDO=
2930

3031
ALL_TARGETS="bin-Fedora bin-Ubuntu docker sign"
3132
# ALL_TARGETS="bin-Fedora bin-Ubuntu tarball deb docker sign"
@@ -47,6 +48,9 @@ for arg; do
4748
--without-zip)
4849
WITHOUT_ZIP=true
4950
;;
51+
--sudo)
52+
SUDO=sudo
53+
;;
5054
--help)
5155
echo "Usage: [--force-version=<ver>] [--force-unclean] [--force-mtime=YYYY-MM-DD] [--verify] [TARGETS]"
5256
echo Known targets: "$ALL_TARGETS"
@@ -201,13 +205,13 @@ if [ -z "${TARGETS##* docker *}" ]; then
201205
DOCKER_OPTS="$DOCKER_OPTS -t $DOCKER_USER/lightningd:latest"
202206
DOCKER_OPTS="$DOCKER_OPTS --cache-to=type=local,dest=/tmp/docker-cache --cache-from=type=local,src=/tmp/docker-cache"
203207
echo "Docker Options: $DOCKER_OPTS"
204-
if sudo docker buildx ls | grep -q 'cln-builder'; then
205-
sudo docker buildx use cln-builder
208+
if $SUDO docker buildx ls | grep -q 'cln-builder'; then
209+
$SUDO docker buildx use cln-builder
206210
else
207-
sudo docker buildx create --name=cln-builder --use
211+
$SUDO docker buildx create --name=cln-builder --use
208212
fi
209213
# shellcheck disable=SC2086
210-
sudo docker buildx build $DOCKER_OPTS .
214+
$SUDO docker buildx build $DOCKER_OPTS .
211215
echo "Pushed multi-platform images tagged as $VERSION and latest"
212216
fi
213217

0 commit comments

Comments
 (0)