Mir

Merge lp:~raof/mir/add-tarball-release-tool into lp:mir

Proposed by Chris Halse Rogers on 2017-10-23
Status: Rejected
Rejected by: Alan Griffiths on 2017-11-16
Proposed branch: lp:~raof/mir/add-tarball-release-tool
Merge into: lp:mir
Diff against target: 48 lines (+44/-0)
1 file modified
tools/make_release_tarball (+44/-0)
To merge this branch: bzr merge lp:~raof/mir/add-tarball-release-tool
Reviewer Review Type Date Requested Status
Alan Griffiths 2017-10-23 Needs Fixing on 2017-10-23
Mir CI Bot continuous-integration Approve on 2017-10-23
Review via email: mp+332609@code.launchpad.net

Commit message

tools: Add a helper to generate a release tarball.

To post a comment you must log in.
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:4298
https://mir-jenkins.ubuntu.com/job/mir-ci/3750/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/5155
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/5392
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/5379
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/5379
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/5379
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/5198
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/5198/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/5198
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/5198/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/5198
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/5198/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/5198
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/5198/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/5198
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/5198/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5198
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5198/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/5198
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/5198/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/5198
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/5198/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3750/rebuild

review: Approve (continuous-integration)
Alan Griffiths (alan-griffiths) wrote :

Mild "Needs Fixing": we should handle -h & --help

review: Needs Fixing

Unmerged revisions

4298. By Chris Halse Rogers on 2017-10-23

Add a tool to make a source tarball.

This must be run from the root of a Mir bzr tree. It will export the most recent revision
as mir-$MIR_VERSION_MAJOR.$MIR_VERSION_MINOR.$MIR_VERSION_PATCRH, test that the tarball
builds, and then test that the tarball installs.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'tools/make_release_tarball'
2--- tools/make_release_tarball 1970-01-01 00:00:00 +0000
3+++ tools/make_release_tarball 2017-10-23 07:19:32 +0000
4@@ -0,0 +1,44 @@
5+#!/bin/bash
6+
7+set -e
8+
9+VERSION_MAJOR=$(grep set.MIR_VERSION_MAJOR CMakeLists.txt | cut -f2 -d' ' | tr -d \))
10+VERSION_MINOR=$(grep set.MIR_VERSION_MINOR CMakeLists.txt | cut -f2 -d' ' | tr -d \))
11+VERSION_PATCH=$(grep set.MIR_VERSION_PATCH CMakeLists.txt | cut -f2 -d' ' | tr -d \))
12+
13+VERSIONED_NAME=mir-$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH
14+
15+SCRATCH_DIR=$(mktemp -d)
16+BUILD_DIR=$(mktemp -d)
17+INSTALL_DIR=$(mktemp -d)
18+
19+function cleanup() {
20+ ARG=$?
21+ [ -d $SCRATCH_DIR ] && rm -r $SCRATCH_DIR
22+ [ -d $BUILD_DIR ] && rm -r $BUILD_DIR
23+ [ -d $INSTALL_DIR ] && rm -r $INSTALL_DIR
24+ exit $ARG
25+}
26+
27+trap cleanup EXIT
28+
29+echo "Generating Mir tarball…"
30+bzr export \
31+ --per-file-timestamps \
32+ --root=$VERSIONED_NAME \
33+ --format=tar - \
34+ | \
35+ xz -9 > $SCRATCH_DIR/$VERSIONED_NAME.tar.xz
36+
37+(cd $SCRATCH_DIR; tar xvJf $SCRATCH_DIR/$VERSIONED_NAME.tar.xz)
38+
39+echo "Testing that the tarball is buildable"
40+(cd $BUILD_DIR ; cmake $SCRATCH_DIR/$VERSIONED_NAME )
41+make -C $BUILD_DIR -j $(nproc)
42+
43+echo "Testing that the tarball is installable"
44+make -C $BUILD_DIR install DESTDIR=$INSTALL_DIR
45+
46+mv $SCRATCH_DIR/$VERSIONED_NAME.tar.xz .
47+echo "$VERSIONED_NAME.tar.xz successfully created and tested"
48+

Subscribers

People subscribed via source and target branches