From 4db441f4dfbc9cb096d4161ad24d33c38c111916 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Oct 2014 16:12:29 -0700 Subject: [PATCH 01/32] Add initial Fedora Dockerfile --- resources/linux/redhat/Dockerfile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 resources/linux/redhat/Dockerfile diff --git a/resources/linux/redhat/Dockerfile b/resources/linux/redhat/Dockerfile new file mode 100644 index 000000000..c06547d45 --- /dev/null +++ b/resources/linux/redhat/Dockerfile @@ -0,0 +1,27 @@ +# VERSION: 0.1 +# DESCRIPTION: Create a .rpm file for the atom editor + +# Base docker image +FROM fedora:20 + +# Install dependencies +RUN yum install -y \ + make \ + gcc \ + gcc-c++ \ + glibc-devel \ + git-core \ + libgnome-keyring-devel \ + rpmdevtools + +# Install node +RUN curl -sL https://rpm.nodesource.com/setup | bash - +RUN yum install -y nodejs + +# Clone atom +RUN git clone https://github.com/atom/atom /src +WORKDIR /src +RUN git reset -q --hard $JANKY_SHA1 + +# Build the RPM +RUN script/build && script/grunt mkrpm From 4ff6366d2be7cd6be822011984b821cd949c59ac Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Oct 2014 16:18:05 -0700 Subject: [PATCH 02/32] Add initial script/cibuild-atom-rpm --- script/cibuild-atom-rpm | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 script/cibuild-atom-rpm diff --git a/script/cibuild-atom-rpm b/script/cibuild-atom-rpm new file mode 100755 index 000000000..ab02627df --- /dev/null +++ b/script/cibuild-atom-rpm @@ -0,0 +1,5 @@ +#!/bin/sh + +set -ex + +docker build -t atom-rpm resources/linux/redhat From 953940c757a9507907e0a45cb3c59afdaa5bb646 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Oct 2014 16:53:22 -0700 Subject: [PATCH 03/32] Move debian Dockerfile to build folder --- Dockerfile => build/debian/Dockerfile | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Dockerfile => build/debian/Dockerfile (100%) diff --git a/Dockerfile b/build/debian/Dockerfile similarity index 100% rename from Dockerfile rename to build/debian/Dockerfile From bd0564e30d8beda724a0ac6882cd63caf498d41d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Oct 2014 17:03:05 -0700 Subject: [PATCH 04/32] Move rpm Dockerfile to root --- resources/linux/redhat/Dockerfile => Dockerfile | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) rename resources/linux/redhat/Dockerfile => Dockerfile (69%) diff --git a/resources/linux/redhat/Dockerfile b/Dockerfile similarity index 69% rename from resources/linux/redhat/Dockerfile rename to Dockerfile index c06547d45..609afec31 100644 --- a/resources/linux/redhat/Dockerfile +++ b/Dockerfile @@ -18,10 +18,5 @@ RUN yum install -y \ RUN curl -sL https://rpm.nodesource.com/setup | bash - RUN yum install -y nodejs -# Clone atom -RUN git clone https://github.com/atom/atom /src -WORKDIR /src -RUN git reset -q --hard $JANKY_SHA1 - -# Build the RPM -RUN script/build && script/grunt mkrpm +ADD . /atom +WORKDIR /atom From 293bd3ad3d7d85654e4c920f43313107f8bed5c1 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Oct 2014 17:03:19 -0700 Subject: [PATCH 05/32] Add initial script/dockerbuild --- script/dockerbuild | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 script/dockerbuild diff --git a/script/dockerbuild b/script/dockerbuild new file mode 100755 index 000000000..c65dd1ae1 --- /dev/null +++ b/script/dockerbuild @@ -0,0 +1,6 @@ +#!/bin/sh + +set -ex + +script/build +script/grunt mkrpm From 00da8a9df645e97224324ee47113f6296129d7b1 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Oct 2014 17:03:30 -0700 Subject: [PATCH 06/32] Build into rpm directory --- build/tasks/mkrpm-task.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/tasks/mkrpm-task.coffee b/build/tasks/mkrpm-task.coffee index ebc4cfb73..0ee425c2f 100644 --- a/build/tasks/mkrpm-task.coffee +++ b/build/tasks/mkrpm-task.coffee @@ -25,6 +25,7 @@ module.exports = (grunt) -> {name, version, description} = grunt.file.readJSON('package.json') buildDir = grunt.config.get('atom.buildDir') + rpmDir = path.join(buildDir, 'rpm') installDir = grunt.config.get('atom.installDir') shareDir = path.join(installDir, 'share', 'atom') iconName = path.join(shareDir, 'resources', 'app', 'resources', 'atom.png') @@ -34,10 +35,10 @@ module.exports = (grunt) -> desktopFilePath = fillTemplate(path.join('resources', 'linux', 'atom.desktop'), data) cmd = path.join('script', 'mkrpm') - args = [specFilePath, desktopFilePath, buildDir] + args = [specFilePath, desktopFilePath, rpmDir] spawn {cmd, args}, (error) -> if error? done(error) else - grunt.log.ok "Created rpm package in #{buildDir}" + grunt.log.ok "Created rpm package in #{rpmDir}" done() From 198d3e90c745baf090e366c0c1916d388e5de156 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Oct 2014 17:04:59 -0700 Subject: [PATCH 07/32] Add initial rpm cibuild script --- script/cibuild-atom-rpm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/script/cibuild-atom-rpm b/script/cibuild-atom-rpm index ab02627df..de306ac1d 100755 --- a/script/cibuild-atom-rpm +++ b/script/cibuild-atom-rpm @@ -2,4 +2,9 @@ set -ex -docker build -t atom-rpm resources/linux/redhat +rm -f atom-rpm.cid +docker build -t atom-rpm . +docker run --cidfile='atom-rpm.cid' atom-rpm /atom/script/dockerbuild + +CONTAINER_ID=`cat atom-rpm.cid` +docker cp "$CONTAINER_ID:/tmp/atom-build/rpm" . From 9cfc451a79adbe087d24c45372ec976e7bc7fcbf Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Oct 2014 17:26:23 -0700 Subject: [PATCH 08/32] Remove RPM directory before rebuilding --- build/tasks/mkrpm-task.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/tasks/mkrpm-task.coffee b/build/tasks/mkrpm-task.coffee index 0ee425c2f..a25cfda75 100644 --- a/build/tasks/mkrpm-task.coffee +++ b/build/tasks/mkrpm-task.coffee @@ -25,7 +25,10 @@ module.exports = (grunt) -> {name, version, description} = grunt.file.readJSON('package.json') buildDir = grunt.config.get('atom.buildDir') + rpmDir = path.join(buildDir, 'rpm') + rm rpmDir + installDir = grunt.config.get('atom.installDir') shareDir = path.join(installDir, 'share', 'atom') iconName = path.join(shareDir, 'resources', 'app', 'resources', 'atom.png') From f4c40c2932f0e38768fa2e59cb55feaf7dce93e2 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Oct 2014 17:26:35 -0700 Subject: [PATCH 09/32] Publish build from dockerbuild --- script/dockerbuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/dockerbuild b/script/dockerbuild index c65dd1ae1..e66b86fba 100755 --- a/script/dockerbuild +++ b/script/dockerbuild @@ -3,4 +3,4 @@ set -ex script/build -script/grunt mkrpm +script/grunt mkrpm publish-build From 4e3d15592ee905d767087aaf9407ffa0bc5b87d8 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Oct 2014 17:26:58 -0700 Subject: [PATCH 10/32] Upload .rpm file when available --- build/tasks/publish-build-task.coffee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/tasks/publish-build-task.coffee b/build/tasks/publish-build-task.coffee index d7a3b8139..a19a47cf6 100644 --- a/build/tasks/publish-build-task.coffee +++ b/build/tasks/publish-build-task.coffee @@ -69,9 +69,15 @@ getAssets = -> else arch = 'amd64' {version} = grunt.file.readJSON('package.json') + sourcePath = "#{buildDir}/atom-#{version}-#{arch}.deb" assetName = "atom-#{arch}.deb" + unless fs.isFileSync(sourcePath) + rpmName = fs.readdirSync("#{buildDir}/rpm")[0] + sourcePath = "#{buildDir}/rpm/#{rpmName}" + assetName = "atom.#{arch}.rpm" + {cp} = require('./task-helpers')(grunt) cp sourcePath, path.join(buildDir, assetName) From 317001b4355377e2a9b1a334d974ef7e49a9179d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Oct 2014 17:27:13 -0700 Subject: [PATCH 11/32] Do everything from dockerbuild script --- script/cibuild-atom-rpm | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/script/cibuild-atom-rpm b/script/cibuild-atom-rpm index de306ac1d..a9be13a57 100755 --- a/script/cibuild-atom-rpm +++ b/script/cibuild-atom-rpm @@ -2,9 +2,5 @@ set -ex -rm -f atom-rpm.cid docker build -t atom-rpm . -docker run --cidfile='atom-rpm.cid' atom-rpm /atom/script/dockerbuild - -CONTAINER_ID=`cat atom-rpm.cid` -docker cp "$CONTAINER_ID:/tmp/atom-build/rpm" . +docker run atom-rpm /atom/script/dockerbuild From b64a5c93e3414d78fb0085b3ae27779181408b37 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Oct 2014 17:32:52 -0700 Subject: [PATCH 12/32] Pass through needed env vars --- script/cibuild-atom-rpm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script/cibuild-atom-rpm b/script/cibuild-atom-rpm index a9be13a57..2ba34bf71 100755 --- a/script/cibuild-atom-rpm +++ b/script/cibuild-atom-rpm @@ -3,4 +3,8 @@ set -ex docker build -t atom-rpm . -docker run atom-rpm /atom/script/dockerbuild +docker run \ + --env JANKYSHA1="$JANKYSHA1" \ + --env JANKY_BRANCH="$JANKY_BRANCH" \ + --env ATOM_ACCESS_TOKEN="$ATOM_ACCESS_TOKEN" \ + atom-rpm /atom/script/dockerbuild From 6b57030bdaedda4d779ad4be670f046ac68d2292 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Oct 2014 17:33:26 -0700 Subject: [PATCH 13/32] Test uploads on this branch --- build/tasks/publish-build-task.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/tasks/publish-build-task.coffee b/build/tasks/publish-build-task.coffee index a19a47cf6..c29ac79d6 100644 --- a/build/tasks/publish-build-task.coffee +++ b/build/tasks/publish-build-task.coffee @@ -22,7 +22,7 @@ module.exports = (gruntObject) -> grunt.registerTask 'publish-build', 'Publish the built app', -> tasks = [] tasks.push('build-docs', 'prepare-docs') if process.platform is 'darwin' - tasks.push('upload-assets') if process.env.JANKY_SHA1 and process.env.JANKY_BRANCH is 'master' + tasks.push('upload-assets') if process.env.JANKY_SHA1 and process.env.JANKY_BRANCH is 'ks-fedora-dockerfile' and process.platform is 'linux' grunt.task.run(tasks) grunt.registerTask 'prepare-docs', 'Move api.json to atom-api.json', -> From 0818e6d736fd9f56edba283064b76074c55456a6 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Oct 2014 17:35:39 -0700 Subject: [PATCH 14/32] Log stack for now --- script/dockerbuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/dockerbuild b/script/dockerbuild index e66b86fba..9c1e1bb80 100755 --- a/script/dockerbuild +++ b/script/dockerbuild @@ -3,4 +3,4 @@ set -ex script/build -script/grunt mkrpm publish-build +script/grunt mkrpm publish-build --stack From 738cdb6e660c7394b7f5704ef2a88a0de74a3c46 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Oct 2014 17:38:06 -0700 Subject: [PATCH 15/32] Add missing _ in env var --- script/cibuild-atom-rpm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/cibuild-atom-rpm b/script/cibuild-atom-rpm index 2ba34bf71..01669ed2b 100755 --- a/script/cibuild-atom-rpm +++ b/script/cibuild-atom-rpm @@ -4,7 +4,7 @@ set -ex docker build -t atom-rpm . docker run \ - --env JANKYSHA1="$JANKYSHA1" \ + --env JANKY_SHA1="$JANKYSHA1" \ --env JANKY_BRANCH="$JANKY_BRANCH" \ --env ATOM_ACCESS_TOKEN="$ATOM_ACCESS_TOKEN" \ atom-rpm /atom/script/dockerbuild From 27ff02ad0e6d12cbf63e121a0258cfdd98da3c4e Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Oct 2014 17:41:25 -0700 Subject: [PATCH 16/32] script/dockerbuild -> script/rpmbuild --- script/cibuild-atom-rpm | 2 +- script/{dockerbuild => rpmbuild} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename script/{dockerbuild => rpmbuild} (100%) diff --git a/script/cibuild-atom-rpm b/script/cibuild-atom-rpm index 01669ed2b..72090971e 100755 --- a/script/cibuild-atom-rpm +++ b/script/cibuild-atom-rpm @@ -7,4 +7,4 @@ docker run \ --env JANKY_SHA1="$JANKYSHA1" \ --env JANKY_BRANCH="$JANKY_BRANCH" \ --env ATOM_ACCESS_TOKEN="$ATOM_ACCESS_TOKEN" \ - atom-rpm /atom/script/dockerbuild + atom-rpm /atom/script/rpmbuild diff --git a/script/dockerbuild b/script/rpmbuild similarity index 100% rename from script/dockerbuild rename to script/rpmbuild From 4f1ec786f08123bb35f16e3ad3ec164d630ed811 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Oct 2014 17:47:13 -0700 Subject: [PATCH 17/32] Add missing _ in env var --- script/cibuild-atom-rpm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/cibuild-atom-rpm b/script/cibuild-atom-rpm index 72090971e..19cdca90a 100755 --- a/script/cibuild-atom-rpm +++ b/script/cibuild-atom-rpm @@ -4,7 +4,7 @@ set -ex docker build -t atom-rpm . docker run \ - --env JANKY_SHA1="$JANKYSHA1" \ + --env JANKY_SHA1="$JANKY_SHA1" \ --env JANKY_BRANCH="$JANKY_BRANCH" \ --env ATOM_ACCESS_TOKEN="$ATOM_ACCESS_TOKEN" \ atom-rpm /atom/script/rpmbuild From 7713720ba74884d7598b6a6886705e057421d117 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Oct 2014 17:47:29 -0700 Subject: [PATCH 18/32] Drop x flag --- script/cibuild-atom-rpm | 2 +- script/rpmbuild | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/script/cibuild-atom-rpm b/script/cibuild-atom-rpm index 19cdca90a..ff9c1a704 100755 --- a/script/cibuild-atom-rpm +++ b/script/cibuild-atom-rpm @@ -1,6 +1,6 @@ #!/bin/sh -set -ex +set -e docker build -t atom-rpm . docker run \ diff --git a/script/rpmbuild b/script/rpmbuild index 9c1e1bb80..9405fd585 100755 --- a/script/rpmbuild +++ b/script/rpmbuild @@ -1,6 +1,6 @@ #!/bin/sh -set -ex +set -e script/build script/grunt mkrpm publish-build --stack From c1197d6390531ad3d5b3296291354774d37d67b8 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Oct 2014 17:50:23 -0700 Subject: [PATCH 19/32] Map BUILD_ATOM_LINUX_ACCESS_TOKEN to ATOM_ACCESS_TOKEN --- script/cibuild-atom-rpm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/cibuild-atom-rpm b/script/cibuild-atom-rpm index ff9c1a704..c5680e502 100755 --- a/script/cibuild-atom-rpm +++ b/script/cibuild-atom-rpm @@ -6,5 +6,5 @@ docker build -t atom-rpm . docker run \ --env JANKY_SHA1="$JANKY_SHA1" \ --env JANKY_BRANCH="$JANKY_BRANCH" \ - --env ATOM_ACCESS_TOKEN="$ATOM_ACCESS_TOKEN" \ + --env ATOM_ACCESS_TOKEN="$BUILD_ATOM_LINUX_ACCESS_TOKEN" \ atom-rpm /atom/script/rpmbuild From 1c1adf5beb1832c0e27092dbc41e90025ddc703b Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Oct 2014 17:57:15 -0700 Subject: [PATCH 20/32] Add missing rm assignment --- build/tasks/mkdeb-task.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/tasks/mkdeb-task.coffee b/build/tasks/mkdeb-task.coffee index cfe04f429..f13c64453 100644 --- a/build/tasks/mkdeb-task.coffee +++ b/build/tasks/mkdeb-task.coffee @@ -3,7 +3,7 @@ path = require 'path' _ = require 'underscore-plus' module.exports = (grunt) -> - {spawn} = require('./task-helpers')(grunt) + {spawn, rm} = require('./task-helpers')(grunt) fillTemplate = (filePath, data) -> template = _.template(String(fs.readFileSync("#{filePath}.in"))) From b65c6da9480019bec97f7908339e16821055bea9 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Oct 2014 18:09:47 -0700 Subject: [PATCH 21/32] Add rm assignment to right task --- build/tasks/mkdeb-task.coffee | 2 +- build/tasks/mkrpm-task.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/tasks/mkdeb-task.coffee b/build/tasks/mkdeb-task.coffee index f13c64453..cfe04f429 100644 --- a/build/tasks/mkdeb-task.coffee +++ b/build/tasks/mkdeb-task.coffee @@ -3,7 +3,7 @@ path = require 'path' _ = require 'underscore-plus' module.exports = (grunt) -> - {spawn, rm} = require('./task-helpers')(grunt) + {spawn} = require('./task-helpers')(grunt) fillTemplate = (filePath, data) -> template = _.template(String(fs.readFileSync("#{filePath}.in"))) diff --git a/build/tasks/mkrpm-task.coffee b/build/tasks/mkrpm-task.coffee index a25cfda75..ae0d58350 100644 --- a/build/tasks/mkrpm-task.coffee +++ b/build/tasks/mkrpm-task.coffee @@ -3,7 +3,7 @@ path = require 'path' _ = require 'underscore-plus' module.exports = (grunt) -> - {spawn} = require('./task-helpers')(grunt) + {spawn, rm} = require('./task-helpers')(grunt) fillTemplate = (filePath, data) -> template = _.template(String(fs.readFileSync("#{filePath}.in"))) From 4b3d3701d545426be351adae5a8dc3b5e90fcc26 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 23 Oct 2014 09:10:16 -0700 Subject: [PATCH 22/32] Add rpm segment in mkrpm script --- build/tasks/mkrpm-task.coffee | 2 +- script/mkrpm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/tasks/mkrpm-task.coffee b/build/tasks/mkrpm-task.coffee index ae0d58350..52ed1c366 100644 --- a/build/tasks/mkrpm-task.coffee +++ b/build/tasks/mkrpm-task.coffee @@ -38,7 +38,7 @@ module.exports = (grunt) -> desktopFilePath = fillTemplate(path.join('resources', 'linux', 'atom.desktop'), data) cmd = path.join('script', 'mkrpm') - args = [specFilePath, desktopFilePath, rpmDir] + args = [specFilePath, desktopFilePath, buildDir] spawn {cmd, args}, (error) -> if error? done(error) diff --git a/script/mkrpm b/script/mkrpm index c0450a590..356f0bfc4 100755 --- a/script/mkrpm +++ b/script/mkrpm @@ -17,6 +17,6 @@ cp ./atom.sh $RPM_BUILD_ROOT/BUILD cp $DESKTOP_FILE $RPM_BUILD_ROOT/BUILD rpmbuild -ba $SPEC_FILE -cp $RPM_BUILD_ROOT/RPMS/$ARCH/atom-*.rpm $BUILD_DIRECTORY +cp $RPM_BUILD_ROOT/RPMS/$ARCH/atom-*.rpm $BUILD_DIRECTORY/rpm rm -rf $RPM_BUILD_ROOT From edacf0222241710929abb0752c32b2319fcdc010 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 23 Oct 2014 09:11:13 -0700 Subject: [PATCH 23/32] :memo: Tweak image description --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 609afec31..76fa18eae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # VERSION: 0.1 -# DESCRIPTION: Create a .rpm file for the atom editor +# DESCRIPTION: Image to build Atom and create a .rpm file # Base docker image FROM fedora:20 From f776678b8392907c38bcbdc6de80f8cd8977c1ae Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 23 Oct 2014 09:20:28 -0700 Subject: [PATCH 24/32] Recreate rpm dir after deleting --- build/tasks/mkrpm-task.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/build/tasks/mkrpm-task.coffee b/build/tasks/mkrpm-task.coffee index 52ed1c366..a98ce86d5 100644 --- a/build/tasks/mkrpm-task.coffee +++ b/build/tasks/mkrpm-task.coffee @@ -28,6 +28,7 @@ module.exports = (grunt) -> rpmDir = path.join(buildDir, 'rpm') rm rpmDir + mkdir rpmDir installDir = grunt.config.get('atom.installDir') shareDir = path.join(installDir, 'share', 'atom') From ff32fff483e265627217b7ec55292149a6edf37b Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 23 Oct 2014 09:28:47 -0700 Subject: [PATCH 25/32] Add missing mkdir assignment --- build/tasks/mkrpm-task.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/tasks/mkrpm-task.coffee b/build/tasks/mkrpm-task.coffee index a98ce86d5..8590049b5 100644 --- a/build/tasks/mkrpm-task.coffee +++ b/build/tasks/mkrpm-task.coffee @@ -3,7 +3,7 @@ path = require 'path' _ = require 'underscore-plus' module.exports = (grunt) -> - {spawn, rm} = require('./task-helpers')(grunt) + {spawn, rm, mkdir} = require('./task-helpers')(grunt) fillTemplate = (filePath, data) -> template = _.template(String(fs.readFileSync("#{filePath}.in"))) From 0417458fbb7543751bf4774ba74af639f6a2cf01 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 23 Oct 2014 09:56:44 -0700 Subject: [PATCH 26/32] Log when token is missing --- build/tasks/publish-build-task.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/tasks/publish-build-task.coffee b/build/tasks/publish-build-task.coffee index c29ac79d6..087e37068 100644 --- a/build/tasks/publish-build-task.coffee +++ b/build/tasks/publish-build-task.coffee @@ -38,6 +38,9 @@ module.exports = (gruntObject) -> grunt.log.ok("Upload time: #{elapsedTime}s") doneCallback(args...) + unless token + done(new Error('ATOM_ACCESS_TOKEN environment variable not set')) + buildDir = grunt.config.get('atom.buildDir') assets = getAssets() From d7019509e304afdfc6dbf81d6bbd28f48e9db82d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 23 Oct 2014 10:01:26 -0700 Subject: [PATCH 27/32] Return early when no token set --- build/tasks/publish-build-task.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/tasks/publish-build-task.coffee b/build/tasks/publish-build-task.coffee index 087e37068..bd45da031 100644 --- a/build/tasks/publish-build-task.coffee +++ b/build/tasks/publish-build-task.coffee @@ -39,7 +39,7 @@ module.exports = (gruntObject) -> doneCallback(args...) unless token - done(new Error('ATOM_ACCESS_TOKEN environment variable not set')) + return done(new Error('ATOM_ACCESS_TOKEN environment variable not set')) buildDir = grunt.config.get('atom.buildDir') assets = getAssets() From 11b5bcff748bffa2cae0b82919901713de6694c0 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 23 Oct 2014 10:10:05 -0700 Subject: [PATCH 28/32] Use BUILD_ATOM_RPM_ACCESS_TOKEN --- script/cibuild-atom-rpm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/cibuild-atom-rpm b/script/cibuild-atom-rpm index c5680e502..788abc5e5 100755 --- a/script/cibuild-atom-rpm +++ b/script/cibuild-atom-rpm @@ -6,5 +6,5 @@ docker build -t atom-rpm . docker run \ --env JANKY_SHA1="$JANKY_SHA1" \ --env JANKY_BRANCH="$JANKY_BRANCH" \ - --env ATOM_ACCESS_TOKEN="$BUILD_ATOM_LINUX_ACCESS_TOKEN" \ + --env ATOM_ACCESS_TOKEN="$BUILD_ATOM_RPM_ACCESS_TOKEN" \ atom-rpm /atom/script/rpmbuild From ef2795ea0debd99f288f9e7713d4eae4e0731534 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 23 Oct 2014 10:35:18 -0700 Subject: [PATCH 29/32] Use bash --- script/cibuild-atom-rpm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/cibuild-atom-rpm b/script/cibuild-atom-rpm index 788abc5e5..d42038ea2 100755 --- a/script/cibuild-atom-rpm +++ b/script/cibuild-atom-rpm @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e From 89157cdf2943038a6a25f4442b8bc6d5805c3385 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 23 Oct 2014 10:49:05 -0700 Subject: [PATCH 30/32] Restore master only uploads --- build/tasks/publish-build-task.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/tasks/publish-build-task.coffee b/build/tasks/publish-build-task.coffee index bd45da031..6de5f4862 100644 --- a/build/tasks/publish-build-task.coffee +++ b/build/tasks/publish-build-task.coffee @@ -22,7 +22,7 @@ module.exports = (gruntObject) -> grunt.registerTask 'publish-build', 'Publish the built app', -> tasks = [] tasks.push('build-docs', 'prepare-docs') if process.platform is 'darwin' - tasks.push('upload-assets') if process.env.JANKY_SHA1 and process.env.JANKY_BRANCH is 'ks-fedora-dockerfile' and process.platform is 'linux' + tasks.push('upload-assets') if process.env.JANKY_SHA1 and process.env.JANKY_BRANCH is 'master' grunt.task.run(tasks) grunt.registerTask 'prepare-docs', 'Move api.json to atom-api.json', -> From 534ace62509f44336042bdede955953e2f1b7919 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 23 Oct 2014 11:09:48 -0700 Subject: [PATCH 31/32] Use x64_64 as arch in rpm name --- build/tasks/publish-build-task.coffee | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/tasks/publish-build-task.coffee b/build/tasks/publish-build-task.coffee index 6de5f4862..d7d7aa540 100644 --- a/build/tasks/publish-build-task.coffee +++ b/build/tasks/publish-build-task.coffee @@ -79,6 +79,10 @@ getAssets = -> unless fs.isFileSync(sourcePath) rpmName = fs.readdirSync("#{buildDir}/rpm")[0] sourcePath = "#{buildDir}/rpm/#{rpmName}" + if process.arch is 'ia32' + arch = 'i386' + else + arch = 'x64_64' assetName = "atom.#{arch}.rpm" {cp} = require('./task-helpers')(grunt) From 8d71cbd5109289f75d9e86be6c1286c1f4c76346 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 23 Oct 2014 11:10:18 -0700 Subject: [PATCH 32/32] :memo: Mention fedora/debian checks --- build/tasks/publish-build-task.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/tasks/publish-build-task.coffee b/build/tasks/publish-build-task.coffee index d7d7aa540..89d791197 100644 --- a/build/tasks/publish-build-task.coffee +++ b/build/tasks/publish-build-task.coffee @@ -73,9 +73,11 @@ getAssets = -> arch = 'amd64' {version} = grunt.file.readJSON('package.json') + # Check for a Debian build sourcePath = "#{buildDir}/atom-#{version}-#{arch}.deb" assetName = "atom-#{arch}.deb" + # Check for a Fedora build unless fs.isFileSync(sourcePath) rpmName = fs.readdirSync("#{buildDir}/rpm")[0] sourcePath = "#{buildDir}/rpm/#{rpmName}"