Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion admin/docker/Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENV DEBIAN_FRONTEND=noninteractive
# Packages required to build and run problemtools
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
rm -f /etc/apt/apt.conf.d/docker-clean \
rm -f /etc/apt/apt.conf.d/docker-clean && \
apt-get update && apt-get install -y \
automake \
build-essential \
Expand Down
2 changes: 1 addition & 1 deletion admin/docker/Dockerfile.fulllangs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ENV DEBIAN_FRONTEND=noninteractive
# All languages, plus curl which we need to fetch pypy2
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
rm -f /etc/apt/apt.conf.d/docker-clean \
rm -f /etc/apt/apt.conf.d/docker-clean && \
apt-get update && apt-get install -y \
curl \
fp-compiler \
Expand Down
2 changes: 1 addition & 1 deletion admin/docker/Dockerfile.githubci
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENV DEBIAN_FRONTEND=noninteractive
# Packages required to build and run problemtools
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
rm -f /etc/apt/apt.conf.d/docker-clean \
rm -f /etc/apt/apt.conf.d/docker-clean && \
apt-get update && apt-get install -y \
automake \
build-essential \
Expand Down
2 changes: 1 addition & 1 deletion admin/docker/Dockerfile.icpclangs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENV DEBIAN_FRONTEND=noninteractive

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
rm -f /etc/apt/apt.conf.d/docker-clean \
rm -f /etc/apt/apt.conf.d/docker-clean && \
apt-get update && apt-get install -y \
gcc \
g++ \
Expand Down
2 changes: 1 addition & 1 deletion admin/docker/Dockerfile.runreqs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ENV DEBIAN_FRONTEND=noninteractive
# (and we need libgmp-dev in other images), we take libgmp-dev here
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
rm -f /etc/apt/apt.conf.d/docker-clean \
rm -f /etc/apt/apt.conf.d/docker-clean && \
apt-get update && apt-get install -y \
dvisvgm \
ghostscript \
Expand Down
19 changes: 15 additions & 4 deletions admin/update_docker.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
#!/bin/bash
set -e

ALLOW_DIRTY=false
TAG=develop
UPDATE_LATEST=false

while getopts "d" opt; do
case $opt in
d) ALLOW_DIRTY=true ;;
\?) echo "Invalid option: -$opt" ;;
esac
done

shift $((OPTIND-1))

if [ "$1" != "" ]; then
TAG=$1
UPDATE_LATEST=true
Expand All @@ -13,12 +24,12 @@ cd $(dirname $(readlink -f $0))/docker
if [[ -n $(git status -s) ]]; then
echo "Repository is dirty."
git status -s
exit 1
[[ "${ALLOW_DIRTY}" != "true" ]] && exit 1
fi

if [[ $(git rev-parse --abbrev-ref HEAD) != ${TAG} && $(git describe --exact-match --tags 2>/dev/null) != ${TAG} ]]; then
echo "Repository is currently not on branch/tag ${TAG}."
exit 1
[[ "${ALLOW_DIRTY}" != "true" ]] && exit 1
fi


Expand All @@ -38,15 +49,15 @@ mkdir -p artifacts
sudo rm -rf artifacts/deb
# Use our build image to build a deb
docker run --rm -v "$(pwd)/../..:/problemtools" -v "$(pwd)/artifacts/deb:/artifacts" problemtools/build:${TAG} \
/bin/bash -c '
/bin/bash -c "
set -e ;
mkdir /build ;
cd /build ;
git config --global --add safe.directory /problemtools/.git ;
git clone --branch ${TAG} /problemtools ;
cd problemtools ;
make builddeb ;
cp ../*.deb /artifacts'
cp ../*.deb /artifacts"
sudo chown -R $USER:$USER artifacts/


Expand Down