Mercurial > hg > easyhg
changeset 706:345c12e02e3e
Further Linux build bits
author | Chris Cannam |
---|---|
date | Wed, 12 Dec 2018 11:12:23 +0000 |
parents | b93d662a12df |
children | 3c2bdbd35ba7 |
files | .hgignore deploy/linux/build-and-test-deb.sh deploy/linux/docker/Dockerfile_deb.in deploy/linux/docker/Dockerfile_test_deb.in |
diffstat | 4 files changed, 99 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgignore Wed Dec 12 10:36:06 2018 +0000 +++ b/.hgignore Wed Dec 12 11:12:23 2018 +0000 @@ -34,3 +34,4 @@ *.AppImage .qmake.stash squashfs-root +*.gen
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/deploy/linux/build-and-test-deb.sh Wed Dec 12 11:12:23 2018 +0000 @@ -0,0 +1,49 @@ +#!/bin/bash +# +# Docker required + +set -eu + +current=$(hg id | awk '{ print $1; }') +release=$(perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' src/version.h) + +case "$current" in + *+) echo "ERROR: Current working copy has been modified - unmodified copy required so we know we can check it out separately and obtain the same contents"; exit 2;; + *);; +esac + +echo +echo "Building Debian deb archive from revision $current..." + +dockerdir=deploy/linux/docker + +cat "$dockerdir"/Dockerfile_deb.in | \ + perl -p -e "s/\[\[REVISION\]\]/$current/g" | \ + perl -p -e "s/\[\[RELEASE\]\]/$release/g" > \ + "$dockerdir"/Dockerfile_deb.gen + +cat "$dockerdir"/Dockerfile_test_deb.in | \ + perl -p -e "s/\[\[REVISION\]\]/$current/g" | \ + perl -p -e "s/\[\[RELEASE\]\]/$release/g" > \ + "$dockerdir"/Dockerfile_test_deb.gen + +grep '^bitbucket.org' ~/.ssh/known_hosts > "$dockerdir"/known_hosts +cp ~/.ssh/id_dsa_build "$dockerdir"/id_dsa_build +chmod 600 "$dockerdir"/known_hosts "$dockerdir"/id_dsa_build +trap "rm $dockerdir/known_hosts $dockerdir/id_dsa_build" 0 + +dockertag="cannam/easymercurial-deb-$current" + +sudo docker build -t "$dockertag" -f "$dockerdir"/Dockerfile_deb.gen "$dockerdir" + +outdir="$dockerdir/output" +mkdir -p "$outdir" + +container=$(sudo docker create "$dockertag") + +sudo docker cp "$container":output-deb.tar "$outdir" +sudo docker rm "$container" + +( cd "$outdir" ; tar xf output-deb.tar && rm -f output-deb.tar ) + +sudo docker build -t "$dockertag"-test -f "$dockerdir"/Dockerfile_test_deb.gen "$dockerdir"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/deploy/linux/docker/Dockerfile_deb.in Wed Dec 12 11:12:23 2018 +0000 @@ -0,0 +1,43 @@ +# This pulls the latest versions of capnp & SV from repos - so you +# will need to defeat the Docker cache by destroying the container +# each time you want to update it +# +FROM ubuntu:14.04 +MAINTAINER Chris Cannam <cannam@all-day-breakfast.com> +RUN apt-get update && \ + apt-get install -y \ + software-properties-common \ + build-essential \ + libbz2-dev \ + libxml2-utils \ + libgl1-mesa-dev \ + qt5-default libqt5svg5-dev \ + git \ + mercurial \ + curl wget \ + mlton \ + autoconf automake libtool lintian + +RUN apt-get clean && rm -rf /var/lib/apt/lists/* + +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 + +WORKDIR /root +COPY id_dsa_build .ssh/id_dsa_build +COPY known_hosts .ssh/known_hosts +RUN chmod 600 .ssh/id_dsa_build .ssh/known_hosts +RUN echo '{"accounts": {"bitbucket": "cannam"}}' > .repoint.json +RUN ( echo '[ui]' ; echo 'ssh = ssh -i /root/.ssh/id_dsa_build' ) > .hgrc + +WORKDIR / +RUN hg clone -r[[REVISION]] ssh://hg@bitbucket.org/cannam/easyhg + +WORKDIR /easyhg +RUN qmake -r +RUN make + +RUN deploy/linux/deploy-deb.sh [[RELEASE]] amd64 +RUN tar cvf output-deb.tar *.deb && cp output-deb.tar ..
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/deploy/linux/docker/Dockerfile_test_deb.in Wed Dec 12 11:12:23 2018 +0000 @@ -0,0 +1,6 @@ +FROM ubuntu:18.04 +RUN apt-get update +ADD output/EasyMercurial_[[RELEASE]]_amd64.deb EasyMercurial_[[RELEASE]]_amd64.deb +RUN apt install -y ./EasyMercurial_[[RELEASE]]_amd64.deb +RUN /usr/bin/EasyMercurial --version +