-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Docker in the build to fix #534.
- Loading branch information
David Braun
authored and
David Braun
committed
Apr 4, 2018
1 parent
f6549c0
commit 5929257
Showing
12 changed files
with
1,071 additions
and
469 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ module.exports = { | |
}, | ||
env: { | ||
browser: true, | ||
jest: true, | ||
node: true | ||
}, | ||
extends: 'standard', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Use Unix line endings for text files because we're using Docker. | ||
* text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM node:9.4.0 | ||
|
||
# Install Wine so that we can build for the 'win32' platform. | ||
# https://wiki.debian.org/Wine#Installation_on_Debian_Jessie_and_newer | ||
RUN dpkg --add-architecture i386 \ | ||
&& apt-get update \ | ||
&& apt-get --yes install \ | ||
wine \ | ||
wine32 \ | ||
libwine | ||
|
||
RUN touch /usr/local/bin/gaia | ||
RUN mkdir -p /usr/src/app | ||
WORKDIR /usr/src/app | ||
COPY entrypoint.sh / | ||
ENTRYPOINT [ "/entrypoint.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use strict' | ||
|
||
const { cli } = require(`@nodeguy/cli`) | ||
const options = require(`./options.json`) | ||
const path = require(`path`) | ||
const shell = require(`shelljs`) | ||
const untildify = require(`untildify`) | ||
|
||
cli(options, async ({ commit, gaia, platform, 'skip-pack': skipPack }) => { | ||
shell.exec(`docker build --tag cosmos/voyager-builder .`) | ||
shell.mkdir(`-p`, `../../builds`) | ||
const cwd = process.cwd() | ||
|
||
shell.exec(`docker run \ | ||
--interactive \ | ||
--mount type=bind,readonly,source=${untildify(gaia)},target=/mnt/gaia \ | ||
--mount type=bind,readonly,source=${path.resolve(cwd, '../../.git')},target=/mnt/.git \ | ||
--mount type=bind,source=${path.resolve(cwd, '../../builds')},target=/mnt/builds \ | ||
--rm \ | ||
cosmos/voyager-builder \ | ||
"${commit}" \ | ||
--gaia=/mnt/gaia \ | ||
--platform=${platform} \ | ||
--skip-pack=${skipPack} | ||
`) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
set -o errexit | ||
|
||
git clone /mnt/.git . | ||
|
||
# Use the specified commit of Voyager. | ||
git checkout "$1" | ||
shift | ||
|
||
ln --symbolic /mnt/builds | ||
yarn install | ||
node tasks/build/release.js "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"commit": ["commit from which to build", "HEAD"], | ||
"gaia": ["path to the gaia binary"], | ||
"platform": ["the target platform {darwin|linux|win32}"], | ||
"skip-pack": ["skip the repackaging of the JS files", false] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.