update gitiles

Signed-off-by: Jess Frazelle <acidburn@jessfraz.com>
This commit is contained in:
Jess Frazelle 2019-09-16 18:18:07 -07:00
parent 609aceb5b2
commit 5df8226ffa
No known key found for this signature in database
GPG Key ID: C0B444E6A3EFD4C1
3 changed files with 21 additions and 34 deletions

View File

@ -1,51 +1,39 @@
FROM alpine:latest FROM ubuntu:bionic
LABEL maintainer "Jessie Frazelle <jess@linux.com>" LABEL maintainer "Jessie Frazelle <jess@linux.com>"
ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk # https://gerrit.googlesource.com/gitiles/
ENV GITILES_VERSION v0.3
RUN apk add --no-cache \ RUN apt-get update && apt-get install -y \
apt-transport-https \
bash \ bash \
ca-certificates \ ca-certificates \
openjdk8 curl \
git \
# https://github.com/bazelbuild/bazel/releases gnupg \
ENV BAZEL_VERSION 0.12.0 openjdk-8-jdk \
# https://gerrit.googlesource.com/gitiles/ --no-install-recommends \
ENV GITILES_VERSION v0.2-1 && rm -rf /var/lib/apt/lists/*
# install bazel # install bazel
RUN set -x \ RUN set -x \
&& apk add --no-cache --virtual=.build-deps \ && echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list \
build-base \ && curl https://bazel.build/bazel-release.pub.gpg | apt-key add - \
curl \ && apt-get update && apt-get install -y \
git \ bazel \
linux-headers \ --no-install-recommends \
python \ && rm -rf /var/lib/apt/lists/* \
zip \
&& : install Bazel to build gitiles \ && : install Bazel to build gitiles \
&& curl -sSL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-dist.zip" -o /tmp/bazel.zip \
&& mkdir "/tmp/bazel-${BAZEL_VERSION}" \
&& unzip -qd "/tmp/bazel-${BAZEL_VERSION}" /tmp/bazel.zip \
&& rm -rf /tmp/bazel.zip \
&& ( \
cd "/tmp/bazel-${BAZEL_VERSION}" \
&& : add -fpermissive compiler option to avoid compilation failure \
&& sed -i -e '/"-std=c++0x"/{h;s//"-fpermissive"/;x;G}' tools/cpp/cc_configure.bzl \
&& : add '#include <sys/stat.h>' to avoid mode_t type error \
&& sed -i -e '/#endif \/\/ COMPILER_MSVC/{h;s//#else/;G;s//#include <sys\/stat.h>/;G;}' third_party/ijar/common.h \
&& bash compile.sh \
&& cp -p output/bazel /usr/bin/ \
) \
&& git clone --depth 1 --branch "${GITILES_VERSION}" https://gerrit.googlesource.com/gitiles /usr/src/gitiles \ && git clone --depth 1 --branch "${GITILES_VERSION}" https://gerrit.googlesource.com/gitiles /usr/src/gitiles \
&& ( \ && ( \
cd /usr/src/gitiles \ cd /usr/src/gitiles \
&& bazel build --incompatible_disallow_uncalled_set_constructor=false gitiles-dev:dev \ && bazel build java/com/google/gitiles/dev \
&& cp -rL bazel-bin bin \ && cp -rL bazel-bin bin \
&& rm -rf bazel-bin \ && rm -rf bazel-bin \
) \ ) \
&& : clean up unneeded packages and files \ && : clean up unneeded packages and files \
&& apk del .build-deps \ && apt purge -y --auto-remove bazel \
&& rm -rf /usr/bin/bazel /tmp/* /root/.cache "/tmp/bazel-${BAZEL_VERSION}" && rm /etc/apt/sources.list.d/bazel.list
COPY start.sh /usr/bin/start.sh COPY start.sh /usr/bin/start.sh

View File

@ -28,4 +28,4 @@ fi
PROPERTIES="$PROPERTIES --jvm_flag=-Dcom.google.gitiles.sourcePath=$ROOT" PROPERTIES="$PROPERTIES --jvm_flag=-Dcom.google.gitiles.sourcePath=$ROOT"
# shellcheck disable=SC2086 # shellcheck disable=SC2086
exec "${ROOT}/bin/gitiles-dev/dev" $PROPERTIES exec "${ROOT}/bin/java/com/google/gitiles/dev/dev" $PROPERTIES

View File

@ -114,7 +114,6 @@ curl/curl
kolide/fleet kolide/fleet
GoogleCloudPlatform/cloud-sdk-docker GoogleCloudPlatform/cloud-sdk-docker
google/gitiles google/gitiles
bazelbuild/bazel
google/guetzli google/guetzli
irssi/irssi irssi/irssi
cryptodotis/irssi-otr cryptodotis/irssi-otr