Commit 2d3e68d3 authored by Matthew Pickering's avatar Matthew Pickering
Browse files

Merge branch 'no-master-lint' into 'master'

Enable MR linter and only push MRs when commits are merged to master

See merge request ghc/ci-images!5
parents 2b69e99d 57065ca9
......@@ -8,16 +8,30 @@ variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
lint:
stage: build
image: hadolint/hadolint:latest-debian
only:
- merge_requests
- master
script:
- find . -name "Dockerfile" -print0 | xargs -0 -n1 hadolint
.build:
stage: build
only:
- master
- merge_requests
script:
- |
CONTAINER_IMAGE="$CONTAINER_IMAGE_BASE/$IMAGE"
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.haskell.org
docker pull $CONTAINER_IMAGE:latest || true
docker build --cache-from $CONTAINER_IMAGE:latest --tag $CONTAINER_IMAGE:$CI_COMMIT_SHA --tag $CONTAINER_IMAGE:latest $IMAGE
docker push $CONTAINER_IMAGE:$CI_COMMIT_SHA
docker push $CONTAINER_IMAGE:latest
if [ -z "$CI_MERGE_REQUEST_ID" ]; then
docker push $CONTAINER_IMAGE:$CI_COMMIT_SHA
docker push $CONTAINER_IMAGE:latest
fi
build-linters:
extends: .build
......
ignored:
- DL3008
......@@ -2,15 +2,18 @@ FROM aarch64/debian:stretch
ENV LANG C.UTF-8
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Core build utilities
RUN apt-get update -qq
RUN apt-get install -qy zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev \
RUN apt-get update \
&& apt-get install --no-install-recommends -qy zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev \
ca-certificates g++ git make automake autoconf gcc \
perl python3 texinfo xz-utils lbzip2 patch openssh-client sudo \
jq wget curl libnuma-dev
# Documentation tools
RUN apt-get install -qy python3-sphinx texlive-xetex texlive-latex-extra
jq wget curl libnuma-dev \
# Documentation tools
python3-sphinx texlive-xetex texlive-latex-extra \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Boot LLVM
ENV PATH /usr/local/bin:$PATH
......@@ -22,12 +25,12 @@ RUN curl $LLVM_TARBALL | tar -xJC .. && \
/opt/llvm6/bin/llc --version
# GHC
RUN curl http://downloads.haskell.org/~ghc/8.6.2/ghc-8.6.2-aarch64-ubuntu_bionic-linux.tar.xz | tar -xJ && \
cd ghc-8.6.2 && \
./configure --prefix=/usr/local LLC=/opt/llvm6/bin/llc OPT=/opt/llvm6/bin/opt && \
make install && \
cd .. && \
rm -Rf ghc-*
RUN curl http://downloads.haskell.org/~ghc/8.6.2/ghc-8.6.2-aarch64-ubuntu_bionic-linux.tar.xz | tar -xJ
WORKDIR /ghc-8.6.2
RUN ./configure --prefix=/usr/local LLC=/opt/llvm6/bin/llc OPT=/opt/llvm6/bin/opt && \
make install
WORKDIR /
RUN rm -Rf ghc-*
RUN ghc --version
# LLVM
......@@ -41,11 +44,11 @@ RUN curl $LLVM_TARBALL | tar -xJC .. && \
$LLC --version
# Cabal
RUN git clone https://github.com/haskell/Cabal && \
cd Cabal && \
git checkout cabal-install-v2.4.1.0 && \
cd cabal-install && \
./bootstrap.sh --global --no-doc
RUN git clone https://github.com/haskell/Cabal
WORKDIR /Cabal
RUN git checkout cabal-install-v2.4.1.0
WORKDIR /Cabal/cabal-install
RUN ./bootstrap.sh --global --no-doc
RUN ls Cabal/cabal-install/dist/build
......
FROM i386/debian:jessie
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV LANG C.UTF-8
RUN echo 'deb http://ppa.launchpad.net/hvr/ghc/ubuntu trusty main' > /etc/apt/sources.list.d/ghc.list
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F6F88286
RUN apt-get update -qq
# Core build utilities
RUN apt-get install -qy zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev \
RUN apt-get update -qq \
&& apt-get install --no-install-recommends -qy zlib1g-dev libtinfo-dev \
libsqlite3-0 libsqlite3-dev \
ca-certificates g++ git make automake autoconf gcc \
perl python3 texinfo xz-utils lbzip2 patch openssh-client sudo \
jq wget curl
# Documentation tools
RUN apt-get install -qy python3-sphinx texlive-xetex texlive-latex-extra
# Core build utilities
RUN apt-get install -qy libgmp-dev:i386
jq wget curl \
# Documentation tools
python3-sphinx texlive-xetex texlive-latex-extra \
# Core build utilities
libgmp-dev:i386 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /tmp
# Get i386 GHC bindist for 32 bit CI builds.
RUN cd /tmp && curl https://downloads.haskell.org/~ghc/8.4.4/ghc-8.4.4-i386-deb8-linux.tar.xz | tar -Jx; \
cd /tmp/ghc-8.4.4 && setarch i386 ./configure --prefix=/opt/ghc-i386/8.4.4 CFLAGS=-m32 --target=i386-unknown-linux --build=i386-unknown-linux --host=i386-unknown-linux; \
cd /tmp/ghc-8.4.4 && make install; \
RUN curl https://downloads.haskell.org/~ghc/8.4.4/ghc-8.4.4-i386-deb8-linux.tar.xz | tar -Jx;
WORKDIR /tmp/ghc-8.4.4
RUN setarch i386 ./configure --prefix=/opt/ghc-i386/8.4.4 CFLAGS=-m32 --target=i386-unknown-linux --build=i386-unknown-linux --host=i386-unknown-linux; \
make install; \
rm -rf /tmp/ghc-8.4.4
ENV PATH /opt/ghc-i386/8.4.4/bin:$PATH
WORKDIR /tmp
# Get Cabal
RUN cd /tmp && \
curl https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-i386-unknown-linux.tar.xz | tar -Jx && \
RUN curl https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-i386-unknown-linux.tar.xz | tar -Jx && \
mv cabal /usr/local/bin/cabal
# Create a normal user.
......
FROM i386/debian:stretch
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV LANG C.UTF-8
# Core build utilities
RUN apt-get update -qq
RUN apt-get install -qy zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev \
RUN apt-get update -qq \
&& apt-get install --no-install-recommends -qy zlib1g-dev libtinfo-dev \
libsqlite3-0 libsqlite3-dev \
ca-certificates g++ git make automake autoconf gcc \
perl python3 texinfo xz-utils lbzip2 patch openssh-client sudo \
jq wget curl
# Documentation tools
RUN apt-get install -qy python3-sphinx texlive-xetex texlive-latex-extra
# Core build utilities
RUN apt-get install -qy libgmp-dev:i386
jq wget curl \
# Documentation tools
python3-sphinx texlive-xetex texlive-latex-extra \
# Core build utilities
libgmp-dev:i386 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /tmp
# Get i386 GHC bindist for 32 bit CI builds.
RUN cd /tmp && curl https://downloads.haskell.org/~ghc/8.4.4/ghc-8.4.4-i386-deb8-linux.tar.xz | tar -Jx; \
cd /tmp/ghc-8.4.4 && setarch i386 ./configure --prefix=/opt/ghc-i386/8.4.4 CFLAGS=-m32 --target=i386-unknown-linux --build=i386-unknown-linux --host=i386-unknown-linux; \
cd /tmp/ghc-8.4.4 && make install; \
RUN curl https://downloads.haskell.org/~ghc/8.4.4/ghc-8.4.4-i386-deb8-linux.tar.xz | tar -Jx;
WORKDIR /tmp/ghc-8.4.4
RUN setarch i386 ./configure --prefix=/opt/ghc-i386/8.4.4 CFLAGS=-m32 --target=i386-unknown-linux --build=i386-unknown-linux --host=i386-unknown-linux; \
make install; \
rm -rf /tmp/ghc-8.4.4
ENV PATH /opt/ghc-i386/8.4.4/bin:$PATH
WORKDIR /tmp
# Get Cabal
RUN cd /tmp && \
curl https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-i386-unknown-linux.tar.xz | tar -Jx && \
RUN curl https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-i386-unknown-linux.tar.xz | tar -Jx && \
mv cabal /usr/local/bin/cabal
# Create a normal user.
......
......@@ -2,29 +2,38 @@ FROM debian:stretch
ENV LANG C.UTF-8
RUN apt-get update -qq; apt-get install -qy gnupg sudo git python3
RUN echo 'deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main' > /etc/apt/sources.list.d/ghc.list
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F6F88286
RUN apt-get update -qq
# Basic Haskell toolchain
RUN apt-get install -qy cabal-install-2.2 ghc-8.4.2
RUN apt-get update -qq; apt-get install --no-install-recommends -qy gnupg sudo git python3 dirmngr \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F6F88286 \
&& apt-get update \
&& apt-get install --no-install-recommends -qy cabal-install-2.2 ghc-8.4.2 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV PATH /home/ghc/.local/bin:/opt/cabal/2.2/bin:/opt/ghc/8.4.2/bin:$PATH
RUN mkdir -p /opt/local/bin
# Create a normal user.
RUN adduser ghc --gecos "GHC builds" --disabled-password
RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc
USER ghc
WORKDIR /home/ghc/
WORKDIR /home/ghc/
# Build Linting tools
RUN cabal update
RUN git clone git://github.com/haskell-infra/git-haskell-org-hooks && \
cd git-haskell-org-hooks && \
cabal install
RUN git clone git://github.com/haskell-infra/git-haskell-org-hooks
WORKDIR /home/ghc/git-haskell-org-hooks
RUN cabal install
ENV PATH /home/ghc/.cabal/bin:$PATH
USER root
RUN mv /home/ghc/.cabal/bin/* /opt/local/bin/
RUN rm -rf /home/ghc/*
USER ghc
WORKDIR /home/ghc
CMD ["bash"]
......@@ -19,7 +19,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
sudo \
wget \
jq \
xz-utils
xz-utils \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY build-toolchain.sh /tmp/
RUN /tmp/build-toolchain.sh x86_64
FROM centos:7
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV LANG C.UTF-8
# Core build utilities
......@@ -22,7 +24,7 @@ RUN yum -y install python-sphinx \
dejavu-sans-mono-fonts
# This is in the PATH when I ssh into the CircleCI machine but somehow
# sphinx-build isn't found during configure unless we explicitly
# sphinx-build isn't found during configure unless we explicitly
# add it here as well; perhaps PATH is being overridden by CircleCI's
# infrastructure?
ENV PATH /usr/libexec/python3-sphinx:$PATH
......@@ -32,16 +34,19 @@ ENV PATH /usr/libexec/python3-sphinx:$PATH
# non-functional user lookup (#15230).
RUN sed -i -e 's/systemd//g' /etc/nsswitch.conf
WORKDIR /tmp
# Install GHC and cabal
RUN cd /tmp && curl https://downloads.haskell.org/~ghc/8.4.4/ghc-8.4.4-x86_64-centos70-linux.tar.xz | tar -Jx; \
cd /tmp/ghc-8.4.4 && ./configure --prefix=/opt/ghc/8.4.4; \
cd /tmp/ghc-8.4.4 && make install; \
rm -rf /tmp/ghc-8.4.4
RUN curl https://downloads.haskell.org/~ghc/8.4.4/ghc-8.4.4-x86_64-centos70-linux.tar.xz | tar -Jx
WORKDIR /tmp/ghc-8.4.4
RUN ./configure --prefix=/opt/ghc/8.4.4 && make install
WORKDIR /tmp
RUN rm -rf /tmp/ghc-8.4.4
ENV PATH /opt/ghc/8.4.4/bin:$PATH
WORKDIR /tmp
# Get Cabal
RUN cd /tmp && \
curl https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-unknown-linux.tar.xz | tar -Jx && \
RUN curl https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-unknown-linux.tar.xz | tar -Jx && \
mv cabal /usr/local/bin/cabal
# Create a normal user.
......
FROM debian:jessie
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV LANG C.UTF-8
# Core build utilities
RUN apt-get update -qq
RUN apt-get install -qy zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev \
RUN apt-get update -qq && apt-get install --no-install-recommends -qy zlib1g-dev \
libtinfo-dev libsqlite3-0 libsqlite3-dev \
ca-certificates g++ git make automake autoconf gcc \
perl python3 texinfo xz-utils lbzip2 patch openssh-client sudo libgmp-dev \
jq wget curl
jq wget curl \
# Documentation tools
python3-sphinx texlive-xetex texlive-latex-extra \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Documentation tools
RUN apt-get install -qy python3-sphinx texlive-xetex texlive-latex-extra
WORKDIR /tmp
# Install GHC and cabal
RUN cd /tmp && curl https://downloads.haskell.org/~ghc/8.4.4/ghc-8.4.4-x86_64-deb8-linux.tar.xz | tar -Jx; \
cd /tmp/ghc-8.4.4 && ./configure --prefix=/opt/ghc/8.4.4; \
cd /tmp/ghc-8.4.4 && make install; \
rm -rf /tmp/ghc-8.4.4
RUN curl https://downloads.haskell.org/~ghc/8.4.4/ghc-8.4.4-x86_64-deb8-linux.tar.xz | tar -Jx;
WORKDIR /tmp/ghc-8.4.4
RUN ./configure --prefix=/opt/ghc/8.4.4; \
make install;
WORKDIR /tmp
RUN rm -rf /tmp/ghc-8.4.4
ENV PATH /opt/ghc/8.4.4/bin:$PATH
# Get Cabal
RUN cd /tmp && \
curl https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-unknown-linux.tar.xz | tar -Jx && \
RUN curl https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-unknown-linux.tar.xz | tar -Jx && \
mv cabal /usr/local/bin/cabal
# Create a normal user.
......
FROM debian:stretch
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV LANG C.UTF-8
RUN apt-get update -qq; apt-get install -qy gnupg
RUN apt-get update -qq; apt-get install --no-install-recommends -qy gnupg dirmngr \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# http://downloads.haskell.org/debian/
RUN echo 'deb http://downloads.haskell.org/debian stretch main' > /etc/apt/sources.list.d/ghc.list
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA3CBA3FFE22B574
RUN apt-get update -qq
# Core build utilities
RUN apt-get install -qy zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev \
RUN apt-get update -qq && apt-get install --no-install-recommends -qy \
zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev \
ca-certificates g++ git make automake autoconf gcc \
perl python3 texinfo xz-utils lbzip2 patch openssh-client sudo \
jq wget curl
# Documentation tools
RUN apt-get install -qy python3-sphinx texlive-xetex texlive-latex-extra
jq wget curl \
# Documentation tools
python3-sphinx texlive-xetex texlive-latex-extra \
cabal-install-2.4 ghc-8.4.4 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Basic Haskell toolchain
RUN apt-get install -qy cabal-install-2.4 ghc-8.4.4
ENV PATH /home/ghc/.local/bin:/opt/cabal/2.4/bin:/opt/ghc/8.4.4/bin:$PATH
......
FROM fedora:27
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV LANG C.UTF-8
# Core build utilities
......@@ -18,7 +20,7 @@ RUN dnf -y install python3-sphinx \
dejavu-sans-mono-fonts
# This is in the PATH when I ssh into the CircleCI machine but somehow
# sphinx-build isn't found during configure unless we explicitly
# sphinx-build isn't found during configure unless we explicitly
# add it here as well; perhaps PATH is being overridden by CircleCI's
# infrastructure?
ENV PATH /usr/libexec/python3-sphinx:$PATH
......@@ -28,16 +30,18 @@ ENV PATH /usr/libexec/python3-sphinx:$PATH
# non-functional user lookup (#15230).
RUN sed -i -e 's/systemd//g' /etc/nsswitch.conf
WORKDIR /tmp
# Install GHC and cabal
RUN cd /tmp && curl https://downloads.haskell.org/~ghc/8.4.4/ghc-8.4.4-x86_64-fedora27-linux.tar.xz | tar -Jx; \
cd /tmp/ghc-8.4.4 && ./configure --prefix=/opt/ghc/8.4.4; \
cd /tmp/ghc-8.4.4 && make install; \
RUN curl https://downloads.haskell.org/~ghc/8.4.4/ghc-8.4.4-x86_64-fedora27-linux.tar.xz | tar -Jx;
WORKDIR /tmp/ghc-8.4.4
RUN ./configure --prefix=/opt/ghc/8.4.4; \
make install; \
rm -rf /tmp/ghc-8.4.4
ENV PATH /opt/ghc/8.4.4/bin:$PATH
WORKDIR /tmp
# Get Cabal
RUN cd /tmp && \
curl https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-unknown-linux.tar.xz | tar -Jx && \
RUN curl https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-unknown-linux.tar.xz | tar -Jx && \
mv cabal /usr/local/bin/cabal
# Create a normal user.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment