From e64f573d8a062140cbfdc8abdf3c580adb7027e3 Mon Sep 17 00:00:00 2001 From: mbilker Date: Mon, 15 Feb 2016 19:19:36 -0500 Subject: [PATCH 1/8] fix(build): add ubuntu 32-bit docker build --- docker/ubuntu32/Dockerfile | 34 ++++++++++++++++++++++++++++++++++ script/cibuild-n1-ubuntu32 | 13 +++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 docker/ubuntu32/Dockerfile create mode 100755 script/cibuild-n1-ubuntu32 diff --git a/docker/ubuntu32/Dockerfile b/docker/ubuntu32/Dockerfile new file mode 100644 index 000000000..3788a8fd8 --- /dev/null +++ b/docker/ubuntu32/Dockerfile @@ -0,0 +1,34 @@ +# VERSION: 0.1 +# DESCRIPTION: Image to build N1 and create a .deb and .rpm file for 32-bit systems, derived from Atom's Dockerfile + +# Base docker image +FROM 32bit/ubuntu:14.04 + +# Force noninteractive mode +ENV DEBIAN_FRONTEND noninteractive + +# Setup NodeSource repository for Node LTS v4.x +RUN apt-get update && apt-get install -y curl +RUN curl -sL https://deb.nodesource.com/setup_4.x | bash - + +# Correct errors with libpam-systemd (indirect dependency of libnotify4) +RUN /bin/ln -sf /bin/true /sbin/initctl +RUN /usr/bin/touch /etc/init.d/systemd-logind + +# Install dependencies (NodeSource setup runs `apt-get update` for us) +RUN apt-get -y install \ + build-essential \ + git \ + fakeroot \ + libgconf2-4 \ + libgnome-keyring-dev \ + libgtk2.0-0 \ + libnotify4 \ + rpm \ + nodejs \ + xvfb + +#RUN npm install -g npm@3.3.10 --loglevel error + +ADD . /n1 +WORKDIR /n1 diff --git a/script/cibuild-n1-ubuntu32 b/script/cibuild-n1-ubuntu32 new file mode 100755 index 000000000..dafa755ea --- /dev/null +++ b/script/cibuild-n1-ubuntu32 @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +# --rm \ +docker build -t n1-32 -f ./docker/ubuntu32/Dockerfile . +docker run \ + --env="CI=true" \ + --volume="$HOME"/.npm:/root/.npm \ + --volume="$HOME"/.nylas/.apm:/root/.nylas/.apm \ + --volume="$HOME"/.nylas/electron:/root/.nylas/electron \ + n1-32 /usr/bin/linux32 /n1/script/cibuild +docker rmi n1-32 From 0fcd9d0a22c844be75cab9982d2131efa54626aa Mon Sep 17 00:00:00 2001 From: mbilker Date: Mon, 15 Feb 2016 19:25:07 -0500 Subject: [PATCH 2/8] fix(build): use special docker build file to run appropriate build tasks --- build/tasks/publish-nylas-build-task.coffee | 4 +++- docker/ubuntu32/Dockerfile | 14 ++++++++------ script/cibuild-n1-ubuntu32 | 10 +++++----- script/dockerbuild | 6 ++++++ script/mkrpm | 5 +++++ 5 files changed, 27 insertions(+), 12 deletions(-) create mode 100755 script/dockerbuild diff --git a/build/tasks/publish-nylas-build-task.coffee b/build/tasks/publish-nylas-build-task.coffee index 27560a88d..989dfee0b 100644 --- a/build/tasks/publish-nylas-build-task.coffee +++ b/build/tasks/publish-nylas-build-task.coffee @@ -10,7 +10,7 @@ packageVersion = null fullVersion = null module.exports = (grunt) -> - {cp, spawn, rm} = require('./task-helpers')(grunt) + {cp, shouldPublishBuild, spawn, rm} = require('./task-helpers')(grunt) appName = -> grunt.config.get('nylasGruntConfig.appName') dmgName = -> "#{appName().split('.')[0]}.dmg" @@ -125,6 +125,8 @@ module.exports = (grunt) -> uploadToS3(buildZipFilename, key).then(resolve).catch(reject) grunt.registerTask "publish-nylas-build", "Publish Nylas build", -> + return false if not shouldPublishBuild() + awsKey = process.env.AWS_ACCESS_KEY_ID ? "" awsSecret = process.env.AWS_SECRET_ACCESS_KEY ? "" diff --git a/docker/ubuntu32/Dockerfile b/docker/ubuntu32/Dockerfile index 3788a8fd8..9784b3fe2 100644 --- a/docker/ubuntu32/Dockerfile +++ b/docker/ubuntu32/Dockerfile @@ -20,13 +20,15 @@ RUN apt-get -y install \ build-essential \ git \ fakeroot \ - libgconf2-4 \ - libgnome-keyring-dev \ - libgtk2.0-0 \ - libnotify4 \ rpm \ - nodejs \ - xvfb + nodejs + +# For when Linux testing is re-enabled +# libgconf2-4 \ +# libgnome-keyring-dev \ +# libgtk2.0-0 \ +# libnotify4 \ +# xvfb #RUN npm install -g npm@3.3.10 --loglevel error diff --git a/script/cibuild-n1-ubuntu32 b/script/cibuild-n1-ubuntu32 index dafa755ea..3bcc43f7c 100755 --- a/script/cibuild-n1-ubuntu32 +++ b/script/cibuild-n1-ubuntu32 @@ -5,9 +5,9 @@ set -e # --rm \ docker build -t n1-32 -f ./docker/ubuntu32/Dockerfile . docker run \ - --env="CI=true" \ - --volume="$HOME"/.npm:/root/.npm \ - --volume="$HOME"/.nylas/.apm:/root/.nylas/.apm \ - --volume="$HOME"/.nylas/electron:/root/.nylas/electron \ - n1-32 /usr/bin/linux32 /n1/script/cibuild + --env PUBLISH_BUILD="$PUBLIC_BUILD" \ + --env TRAVIS="$TRAVIS" \ + --env TRAVIS_PULL_REQUEST="$TRAVIS_PULL_REQUEST" \ + --env TRAVIS_BRANCH="$TRAVIS_BRANCH" \ + n1-32 /usr/bin/linux32 /n1/script/dockerbuild docker rmi n1-32 diff --git a/script/dockerbuild b/script/dockerbuild new file mode 100755 index 000000000..f2dac6c08 --- /dev/null +++ b/script/dockerbuild @@ -0,0 +1,6 @@ +#!/bin/sh + +set -e + +script/build +script/grunt mkdeb mkrpm publish-nylas-build --stack --no-color --install-dir /usr diff --git a/script/mkrpm b/script/mkrpm index 7762d0f89..9849d02f2 100755 --- a/script/mkrpm +++ b/script/mkrpm @@ -11,6 +11,11 @@ APP_FILE_NAME="$5" RPM_BUILD_ROOT=~/rpmbuild ARCH=`uname -m` +# Work around for `uname -m` returning i686 when rpmbuild uses i386 instead +if [ "$ARCH" = "i686" ]; + ARCH = "i386" +fi + # rpmdev-setuptree mkdir -p $RPM_BUILD_ROOT/BUILD mkdir -p $RPM_BUILD_ROOT/SPECS From eb2f45534e088ccfd38403d112cb15fbf1bb3ccf Mon Sep 17 00:00:00 2001 From: mbilker Date: Mon, 15 Feb 2016 19:42:30 -0500 Subject: [PATCH 3/8] fix(build): typo with PUBLISH_BUILD environment variable --- script/cibuild-n1-ubuntu32 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/cibuild-n1-ubuntu32 b/script/cibuild-n1-ubuntu32 index 3bcc43f7c..9926c6168 100755 --- a/script/cibuild-n1-ubuntu32 +++ b/script/cibuild-n1-ubuntu32 @@ -5,7 +5,7 @@ set -e # --rm \ docker build -t n1-32 -f ./docker/ubuntu32/Dockerfile . docker run \ - --env PUBLISH_BUILD="$PUBLIC_BUILD" \ + --env PUBLISH_BUILD="$PUBLISH_BUILD" \ --env TRAVIS="$TRAVIS" \ --env TRAVIS_PULL_REQUEST="$TRAVIS_PULL_REQUEST" \ --env TRAVIS_BRANCH="$TRAVIS_BRANCH" \ From 37005ca80b669417677a88850468ff58914b8620 Mon Sep 17 00:00:00 2001 From: mbilker Date: Mon, 15 Feb 2016 20:05:01 -0500 Subject: [PATCH 4/8] fix(build): add python as build dependency --- docker/ubuntu32/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/ubuntu32/Dockerfile b/docker/ubuntu32/Dockerfile index 9784b3fe2..d4596c263 100644 --- a/docker/ubuntu32/Dockerfile +++ b/docker/ubuntu32/Dockerfile @@ -18,8 +18,9 @@ RUN /usr/bin/touch /etc/init.d/systemd-logind # Install dependencies (NodeSource setup runs `apt-get update` for us) RUN apt-get -y install \ build-essential \ - git \ fakeroot \ + git \ + python \ rpm \ nodejs From 13e5434abcb7fb7b6b55abf02c2e1af7f4010433 Mon Sep 17 00:00:00 2001 From: mbilker Date: Mon, 15 Feb 2016 20:06:20 -0500 Subject: [PATCH 5/8] fix(mkrpm): add in missing `then` command --- script/mkrpm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/mkrpm b/script/mkrpm index 9849d02f2..c129ca815 100755 --- a/script/mkrpm +++ b/script/mkrpm @@ -12,7 +12,7 @@ RPM_BUILD_ROOT=~/rpmbuild ARCH=`uname -m` # Work around for `uname -m` returning i686 when rpmbuild uses i386 instead -if [ "$ARCH" = "i686" ]; +if [ "$ARCH" = "i686" ]; then ARCH = "i386" fi From d1c3ecb07465d3d82a3f6fdf1a7f3842ad691545 Mon Sep 17 00:00:00 2001 From: mbilker Date: Mon, 15 Feb 2016 20:07:09 -0500 Subject: [PATCH 6/8] fix(docker): add build dependency libgnome-keyring --- docker/ubuntu32/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/ubuntu32/Dockerfile b/docker/ubuntu32/Dockerfile index d4596c263..62f827de0 100644 --- a/docker/ubuntu32/Dockerfile +++ b/docker/ubuntu32/Dockerfile @@ -20,13 +20,13 @@ RUN apt-get -y install \ build-essential \ fakeroot \ git \ + libgnome-keyring-dev \ python \ rpm \ nodejs # For when Linux testing is re-enabled # libgconf2-4 \ -# libgnome-keyring-dev \ # libgtk2.0-0 \ # libnotify4 \ # xvfb From dce7484e44483e9645612f1eb05d4b98602e37ac Mon Sep 17 00:00:00 2001 From: mbilker Date: Mon, 15 Feb 2016 20:26:00 -0500 Subject: [PATCH 7/8] fix(mkrpm): remove spaces before/after `=` --- script/mkrpm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/mkrpm b/script/mkrpm index c129ca815..e9f605ab9 100755 --- a/script/mkrpm +++ b/script/mkrpm @@ -13,7 +13,7 @@ ARCH=`uname -m` # Work around for `uname -m` returning i686 when rpmbuild uses i386 instead if [ "$ARCH" = "i686" ]; then - ARCH = "i386" + ARCH="i386" fi # rpmdev-setuptree From fd162ac4da60ee06c359b918129e528c93102ef1 Mon Sep 17 00:00:00 2001 From: mbilker Date: Mon, 15 Feb 2016 21:12:17 -0500 Subject: [PATCH 8/8] fix(publish-nylas-build): return undefined to prevent grunt interpreting as failed build --- build/tasks/publish-nylas-build-task.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/tasks/publish-nylas-build-task.coffee b/build/tasks/publish-nylas-build-task.coffee index 989dfee0b..850b8ef8a 100644 --- a/build/tasks/publish-nylas-build-task.coffee +++ b/build/tasks/publish-nylas-build-task.coffee @@ -125,7 +125,7 @@ module.exports = (grunt) -> uploadToS3(buildZipFilename, key).then(resolve).catch(reject) grunt.registerTask "publish-nylas-build", "Publish Nylas build", -> - return false if not shouldPublishBuild() + return unless shouldPublishBuild() awsKey = process.env.AWS_ACCESS_KEY_ID ? "" awsSecret = process.env.AWS_SECRET_ACCESS_KEY ? ""