Skip to content

Commit f469edd

Browse files
authored
ci: correctly cleanup ctags tmp in docker (#1043)
1 parent 36ce97f commit f469edd

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ FROM alpine:3
2727
RUN apk add --no-cache git ca-certificates bind-tools tini jansson wget
2828

2929
COPY --chmod=755 install-ctags-alpine.sh /usr/local/bin/install-ctags-alpine.sh
30-
RUN /usr/local/bin/install-ctags-alpine.sh && rm /usr/local/bin/install-ctags-alpine.sh
30+
RUN /usr/local/bin/install-ctags-alpine.sh && \
31+
rm /usr/local/bin/install-ctags-alpine.sh \
32+
/usr/local/bin/universal-optscript
3133

3234
RUN addgroup -S zoekt && \
3335
adduser -S -G zoekt -h /home/zoekt zoekt && \

install-ctags-alpine.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ CTAGS_ARCHIVE_TOP_LEVEL_DIR=ctags-6.1.0
99
# When using commits you can rely on
1010
# CTAGS_ARCHIVE_TOP_LEVEL_DIR=ctags-$CTAGS_VERSION
1111

12+
CTAGS_TMPDIR=
13+
1214
cleanup() {
1315
apk --no-cache --purge del ctags-build-deps || true
1416
cd /
15-
rm -rf /tmp/ctags-$CTAGS_VERSION
17+
if [ -n "$CTAGS_TMPDIR" ]; then
18+
rm -rf "$CTAGS_TMPDIR"
19+
fi
1620
}
1721

1822
trap cleanup EXIT
@@ -35,11 +39,12 @@ apk --no-cache add \
3539
apk --no-cache add jansson
3640

3741
NUMCPUS=$(grep -c '^processor' /proc/cpuinfo)
42+
CTAGS_TMPDIR=$(mktemp -d /tmp/ctags.XXXXXX)
3843

3944
# Installation
40-
curl --retry 5 "https://codeload.github.com/universal-ctags/ctags/tar.gz/$CTAGS_VERSION" | tar xz -C /tmp
41-
cd /tmp/$CTAGS_ARCHIVE_TOP_LEVEL_DIR
45+
curl --retry 5 "https://codeload.github.com/universal-ctags/ctags/tar.gz/$CTAGS_VERSION" | tar xz -C "$CTAGS_TMPDIR"
46+
cd "$CTAGS_TMPDIR/$CTAGS_ARCHIVE_TOP_LEVEL_DIR"
4247
./autogen.sh
43-
./configure --program-prefix=universal- --enable-json
48+
./configure --program-prefix=universal- --enable-json --disable-readcmd
4449
make -j"$NUMCPUS" --load-average="$NUMCPUS"
4550
make install

0 commit comments

Comments
 (0)