Mercurial > hg > easyhg
changeset 701:0720152d1914
Further Linux packaging work
author | Chris Cannam |
---|---|
date | Wed, 12 Dec 2018 10:23:55 +0000 |
parents | 21e4df9865af |
children | ce1609627ff4 |
files | deploy/linux/build-and-test-appimage.sh deploy/linux/docker/Dockerfile_appimage.in deploy/linux/docker/Dockerfile_test_appimage.in |
diffstat | 3 files changed, 99 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/deploy/linux/build-and-test-appimage.sh Wed Dec 12 10:23:55 2018 +0000 @@ -0,0 +1,46 @@ +#!/bin/bash +# +# Docker required + +set -eu + +current=$(hg id | awk '{ print $1; }') + +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 appimage from revision $current..." + +dockerdir=deploy/linux/docker + +cat "$dockerdir"/Dockerfile_appimage.in | \ + perl -p -e "s/\[\[REVISION\]\]/$current/g" > \ + "$dockerdir"/Dockerfile_appimage.gen + +cat "$dockerdir"/Dockerfile_test_appimage.in | \ + perl -p -e "s/\[\[REVISION\]\]/$current/g" > \ + "$dockerdir"/Dockerfile_test_appimage.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-appimage-$current" + +sudo docker build -t "$dockertag" -f "$dockerdir"/Dockerfile_appimage.gen "$dockerdir" + +outdir="$dockerdir/output" +mkdir -p "$outdir" + +container=$(sudo docker create "$dockertag") + +sudo docker cp "$container":output-appimage.tar "$outdir" +sudo docker rm "$container" + +( cd "$outdir" ; tar xf output-appimage.tar && rm -f output-appimage.tar ) + +sudo docker build -t "$dockertag"-test -f "$dockerdir"/Dockerfile_test_appimage.gen "$dockerdir"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/deploy/linux/docker/Dockerfile_appimage.in Wed Dec 12 10:23:55 2018 +0000 @@ -0,0 +1,45 @@ +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 \ + git \ + mercurial \ + curl wget \ + mlton \ + autoconf automake libtool lintian + +RUN apt-add-repository -y ppa:beineri/opt-qt-5.10.1-trusty +RUN apt-get update && \ + apt-get install -y \ + qt510base \ + qt510svg +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://bitbucket.org/cannam/easyhg + +WORKDIR /easyhg +ENV QTDIR /opt/qt510 +ENV PATH /opt/qt510/bin:$PATH +RUN ./configure +RUN make + +RUN deploy/linux/deploy-appimage.sh +RUN tar cvf output-appimage.tar *.AppImage && cp output-appimage.tar ..
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/deploy/linux/docker/Dockerfile_test_appimage.in Wed Dec 12 10:23:55 2018 +0000 @@ -0,0 +1,8 @@ +FROM centos:7 +RUN yum update +RUN yum -y groupinstall "X Window System" +RUN yum -y install wget +ADD output/EasyMercurial-[[REVISION]]-x86_64.AppImage EasyMercurial.AppImage +RUN chmod +x EasyMercurial.AppImage +RUN ./EasyMercurial.AppImage --appimage-extract +RUN ./squashfs-root/AppRun --version