Skip to content

Commit

Permalink
workflow test
Browse files Browse the repository at this point in the history
  • Loading branch information
yairgott committed Jan 23, 2025
1 parent ed26d02 commit c781a27
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,22 @@ RUN wget -O /usr/local/bin/buildifier https://github.com/bazelbuild/buildtools/r
# Add bazel/buildifier to PATH
ENV PATH="/usr/local/bin:$PATH"
RUN echo '#!/bin/bash\n\
set +e\n\
LOCKFILE="/tmp/rebuild_comp_db.lock"\n\
if [ -e "$LOCKFILE" ] && kill -0 "$(cat "$LOCKFILE")" 2>/dev/null; then\n\
set +e\n\
LOCKFILE="/tmp/rebuild_comp_db.lock"\n\
if [ -e "$LOCKFILE" ] && kill -0 "$(cat "$LOCKFILE")" 2>/dev/null; then\n\
echo "Script is already running. Exiting."\n\
exit 1\n\
fi\n\
echo $$ > "$LOCKFILE"\n\
trap "rm -f $LOCKFILE" EXIT\n\
if [ ! -d "/workspaces/valkey-search" ]; then\n\
echo "Error: Directory /workspaces/valkey-search does not exist."\n\
exit 1\n\
fi\n\
cd /workspaces/valkey-search\n\
while sleep 1; do\n\
find src testing vmsdk/src vmsdk/testing -type f \\( -iname \\*.cc -o -iname \\*.h -o -iname BUILD \\) | entr -d bazel run @hedron_compile_commands//:refresh_all &> /dev/null\n\
done' > /usr/local/bin/refresh_comp_db.sh && chmod +x /usr/local/bin/refresh_comp_db.sh
fi\n\
echo $$ > "$LOCKFILE"\n\
trap "rm -f $LOCKFILE" EXIT\n\
if [ ! -d "/workspaces/valkey-search" ]; then\n\
echo "Error: Directory /workspaces/valkey-search does not exist."\n\
exit 1\n\
fi\n\
cd /workspaces/valkey-search\n\
while sleep 1; do\n\
find src testing vmsdk/src vmsdk/testing -type f \\( -iname \\*.cc -o -iname \\*.h -o -iname BUILD \\) | entr -d bazel run @hedron_compile_commands//:refresh_all &> /dev/null\n\
done' > /usr/local/bin/refresh_comp_db.sh && chmod +x /usr/local/bin/refresh_comp_db.sh
# Set working directory
WORKDIR /workspace

Expand All @@ -84,12 +84,10 @@ RUN echo 'if ! command -v vi &> /dev/null; then alias vi="vim"; fi' >> /home/vsc
ARG ENABLE_COMP_DB_REFRESH=true
ENV ENABLE_COMP_DB_REFRESH=${ENABLE_COMP_DB_REFRESH}

# Example: Conditionally install a package
RUN if [ "$ENABLE_COMP_DB_REFRESH" = "true" ]; then \
echo 'refresh_comp_db.sh &> /dev/null &' >> /home/vscode/.bashrc \
echo 'refresh_comp_db.sh &> /dev/null &' >> /home/vscode/.bashrc; \
fi

RUN echo 'refresh_comp_db.sh &> /dev/null &' >> /home/vscode/.bashrc
# Ensure the history file exists and configure permissions
RUN touch /home/vscode/.bash_history && chmod 600 /home/vscode/.bash_history

Expand Down

0 comments on commit c781a27

Please sign in to comment.